Skip to content

Instantly share code, notes, and snippets.

@yegle

yegle/example.py

Created Jan 21, 2013
Embed
What would you like to do?
How to use Django's get_readonly_fields
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
You can’t perform that action at this time.