1 2 3 4 5 6 7 | class ValidatedModel(models.Model):
def save(self, *args, **kwargs):
self.full_clean()
super(ValidatedModel, self).save(*args, **kwargs)
class Meta:
abstract = True
|
More like this
- Run model validation before saving a model instance by buriy 2 years, 4 months ago
- Character encoding fix by mrtron 5 years ago
- Render markdown to a separate model field by mindcruzer 8 months ago
- "Autoconnect" model decorator, easy pre_save and post_save signal connection by bendavis78 2 years, 10 months ago
- decorator to add GUID Field to Django Models by trubliphone 3 months, 2 weeks ago
Comments