Skip to content

Instantly share code, notes, and snippets.

@jdunck
Created November 30, 2011 23:01
Show Gist options
  • Save jdunck/1411661 to your computer and use it in GitHub Desktop.
Save jdunck/1411661 to your computer and use it in GitHub Desktop.
validate everywhere
from django.db.models import Model
class ModelBase(Model):
class Meta:
abstract = True
def save(self, *args, **kwargs):
self.full_clean()
super(ModelBase, self).save(*args,**kwargs)
class Person(ModelBase):
# whatever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment