1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #10059: ModelAdmin.formfield_for_dbfield now handles custom Field subclasses. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10454 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-04-08 20:25:56 +00:00
parent 6eaf154a2e
commit f55f2b9d74
3 changed files with 13 additions and 6 deletions

View File

@@ -4,6 +4,9 @@ from django.db import models
from django.core.files.storage import default_storage
from django.contrib.auth.models import User
class MyFileField(models.FileField):
pass
class Member(models.Model):
name = models.CharField(max_length=100)
birthdate = models.DateTimeField(blank=True, null=True)
@@ -23,6 +26,7 @@ class Album(models.Model):
band = models.ForeignKey(Band)
name = models.CharField(max_length=100)
cover_art = models.FileField(upload_to='albums')
backside_art = MyFileField(upload_to='albums_back', null=True)
def __unicode__(self):
return self.name