1
0
mirror of https://github.com/django/django.git synced 2024-12-26 19:16:11 +00:00

Fixed #1403 -- 'Add' green plus sign no longer appears in admin change forms for fields whose related models don't have an admin

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2991 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-05-26 17:54:19 +00:00
parent 374d02e598
commit b63157c616

View File

@ -118,7 +118,7 @@ class AdminBoundField(object):
self.raw_id_admin = use_raw_id_admin(field) self.raw_id_admin = use_raw_id_admin(field)
self.is_date_time = isinstance(field, models.DateTimeField) self.is_date_time = isinstance(field, models.DateTimeField)
self.is_file_field = isinstance(field, models.FileField) self.is_file_field = isinstance(field, models.FileField)
self.needs_add_label = field.rel and isinstance(field.rel, models.ManyToOneRel) or isinstance(field.rel, models.ManyToManyRel) and field.rel.to._meta.admin self.needs_add_label = field.rel and (isinstance(field.rel, models.ManyToOneRel) or isinstance(field.rel, models.ManyToManyRel)) and field.rel.to._meta.admin
self.hidden = isinstance(self.field, models.AutoField) self.hidden = isinstance(self.field, models.AutoField)
self.first = False self.first = False