1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.0.X] Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be callables. Thanks to fas for the report and patch.

Merge of r10652 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2009-05-02 07:16:30 +00:00
parent 3c222b1b8b
commit d22290b2ce
5 changed files with 122 additions and 12 deletions

View File

@@ -14,3 +14,17 @@ class Triple(models.Model):
class FilePathModel(models.Model):
path = models.FilePathField(path=os.path.dirname(__file__), match=".*\.py$", blank=True)
class Publication(models.Model):
title = models.CharField(max_length=30)
date = models.DateField()
def __unicode__(self):
return self.title
class Article(models.Model):
headline = models.CharField(max_length=100)
publications = models.ManyToManyField(Publication)
def __unicode__(self):
return self.headline