Loading AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,7 @@ answer newbie questions, and generally made Django that much better: smurf@smurf.noris.de Vsevolod Solovyov George Song <george@damacy.net> Jimmy Song <jaejoon@gmail.com> sopel Leo Soto <leo.soto@gmail.com> Wiliam Alves de Souza <wiliamsouza83@gmail.com> Loading docs/ref/models/instances.txt +13 −9 Original line number Diff line number Diff line Loading @@ -140,9 +140,13 @@ attributes on your model if desired. For instance, you could use it to automatically provide a value for a field, or to do validation that requires access to more than a single field:: def clean(self): import datetime from django.core.exceptions import ValidationError from django.db import models class Article(models.Model): ... def clean(self): # Don't allow draft entries to have a pub_date. if self.status == 'draft' and self.pub_date is not None: raise ValidationError('Draft entries may not have a publication date.') Loading Loading
AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,7 @@ answer newbie questions, and generally made Django that much better: smurf@smurf.noris.de Vsevolod Solovyov George Song <george@damacy.net> Jimmy Song <jaejoon@gmail.com> sopel Leo Soto <leo.soto@gmail.com> Wiliam Alves de Souza <wiliamsouza83@gmail.com> Loading
docs/ref/models/instances.txt +13 −9 Original line number Diff line number Diff line Loading @@ -140,9 +140,13 @@ attributes on your model if desired. For instance, you could use it to automatically provide a value for a field, or to do validation that requires access to more than a single field:: def clean(self): import datetime from django.core.exceptions import ValidationError from django.db import models class Article(models.Model): ... def clean(self): # Don't allow draft entries to have a pub_date. if self.status == 'draft' and self.pub_date is not None: raise ValidationError('Draft entries may not have a publication date.') Loading