Created
July 26, 2018 14:08
-
-
Save paulwinex/ae62175fac35f5337a1091a2c7de62e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def formfield_for_dbfield(self, db_field, **kwargs): | |
field = super(AuthorAdmin, self).formfield_for_dbfield(db_field, **kwargs) | |
if db_field.name == 'user': | |
field.queryset = GenericUser.objects.all().order_by('email') | |
return field |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment