mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be callables. Thanks to fas for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user