Created
January 21, 2013 00:29
-
-
Save yegle/4582809 to your computer and use it in GitHub Desktop.
How to use Django's get_readonly_fields
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 get_readonly_fields(self, request, obj=None): | |
if obj and obj.is_processed: | |
return ('csv_file',) + self.readonly_fields | |
else: | |
return self.readonly_fields |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment