-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Milestone
Description
https://github.com/django/django/blob/stable/1.4.x/django/db/models/base.py#L617
https://github.com/django/django/blob/stable/1.4.x/django/db/models/base.py#L809
example:
class Person(Document):
name = StringField()
status = StringField()
partner = ReferenceField()
def clean(self):
if self.status == 'married' and not self.partner:
raise ValidationError("Partner is missing", field_name="partner")
elif self.status == 'single':
self.partner = None
Metadata
Metadata
Assignees
Labels
No labels