1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[soc2009/model-validation] Added simple tests for ForeignKey validation.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10879 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král
2009-06-01 15:42:29 +00:00
parent afcb3c8872
commit eae2b9c149
2 changed files with 19 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ class ModelToValidate(models.Model):
name = models.CharField(max_length=100)
created = models.DateTimeField(default=datetime.now)
number = models.IntegerField()
parent = models.ForeignKey('self', blank=True, null=True)
def validate(self):
super(ModelToValidate, self).validate()