Skip to content Skip to sidebar Skip to footer

Django : How To Use Signals?

After creating a user account with this model: class User(auth.models.User, auth.models.PermissionsMixin): def __str__(self): return '@{}'.format(self.username) The f

Solution 1:

Its too simple. you can write your saving history code here:

def send_data(sender, instance, created, **kwargs):
    from your_app.models import History
    history = History()
    history.employee_ID = instance.username
    history.name = instance.first_name
    ....
    history.save()

Post a Comment for "Django : How To Use Signals?"