Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

abstract user in django


@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
    if created:
        User.objects.create(user=instance)

@receiver(post_save, sender=User)
def save_profile(sender, instance, **kwargs):
    instance.user.save()

Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #abstract #user #django
ADD COMMENT
Topic
Name
9+5 =