Created
November 23, 2013 16:31
-
-
Save bmease/7616715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@receiver(post_save, sender=User) | |
def create_default_shelves(sender, **kwargs): | |
'''Creates default shelves for a user''' | |
if kwargs['created'] is True: | |
user = kwargs['instance'] | |
for name, slug in DEFAULT_SHELF_NAMES: | |
shelf = Shelf(name=name, slug=slug, user=user) | |
shelf.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment