Skip to content

Instantly share code, notes, and snippets.

NotSqrt NotSqrt

Block or report user

Report or block NotSqrt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@NotSqrt
NotSqrt / settings_test_snippet.py
Last active Aug 7, 2019 — forked from nealtodd/settings_test_snippet.py
Another shot at this problem ..
View settings_test_snippet.py
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@NotSqrt
NotSqrt / list_display
Created Jul 6, 2013
default populating of list_display with all the fields
View list_display
class CommonAdmin(admin.ModelAdmin):
ordering = ['id']
def __init__(self, *args, **kwargs):
super(CommonAdmin, self).__init__(*args, **kwargs)
self.set_list_display(args[0]) # set fields to display --> all of them
def set_list_display(self, model):
fields = []
for field in model._meta.fields:
You can’t perform that action at this time.