Last active
August 29, 2015 14:04
-
-
Save christabor/12a5dd5d97e46c70ad60 to your computer and use it in GitHub Desktop.
Get all django model fields in one go...
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
from django.db import models | |
DJANGO_FIELDS = ( | |
(str(field).upper(), field) | |
for field in dir(models) if field.endswith('Field') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment