Skip to content

Instantly share code, notes, and snippets.

@kezabelle
Created May 8, 2017 13:35
Show Gist options
  • Save kezabelle/795596e2d71f74b5ca068d421cfaa4cd to your computer and use it in GitHub Desktop.
Save kezabelle/795596e2d71f74b5ca068d421cfaa4cd to your computer and use it in GitHub Desktop.
Finding use of exclude on a modelform ...
from django.forms.models import ModelFormOptions
def lol(self, k, v):
if k == "exclude" and v:
print(v)
return setattr(self, k, v)
ModelFormOptions.__setattr__ = lol.__get__(ModelFormOptions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment