Skip to content

Instantly share code, notes, and snippets.

@bluethon
Created November 3, 2016 06:44
Show Gist options
  • Save bluethon/901f4e01115f30b2142b381bc8d08d36 to your computer and use it in GitHub Desktop.
Save bluethon/901f4e01115f30b2142b381bc8d08d36 to your computer and use it in GitHub Desktop.
class CustomAdmin(admin.ModelAdmin):
def get_readonly_fields(self, request, obj=None):
# ...
return [f.name for f in self.model._meta.fields]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment