mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
newforms-admin: Fixed #4629. Implemented raw_id_fields for inlines.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7eb538fd46
commit
d8411ca54d
@ -623,7 +623,7 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
``model`` to its parent. This is required if ``model`` has more than one
|
``model`` to its parent. This is required if ``model`` has more than one
|
||||||
``ForeignKey`` to its parent.
|
``ForeignKey`` to its parent.
|
||||||
"""
|
"""
|
||||||
def __init__(self, model, name=None, extra=3, fields=None, template=None):
|
def __init__(self, model, name=None, extra=3, fields=None, template=None, raw_id_fields=None):
|
||||||
self.model = model
|
self.model = model
|
||||||
self.opts = model._meta
|
self.opts = model._meta
|
||||||
self.name = name
|
self.name = name
|
||||||
@ -633,6 +633,7 @@ class InlineModelAdmin(BaseModelAdmin):
|
|||||||
self.verbose_name = model._meta.verbose_name
|
self.verbose_name = model._meta.verbose_name
|
||||||
self.verbose_name_plural = model._meta.verbose_name_plural
|
self.verbose_name_plural = model._meta.verbose_name_plural
|
||||||
self.prepopulated_fields = {}
|
self.prepopulated_fields = {}
|
||||||
|
self.raw_id_fields = raw_id_fields or ()
|
||||||
|
|
||||||
class StackedInline(InlineModelAdmin):
|
class StackedInline(InlineModelAdmin):
|
||||||
default_template = 'admin/edit_inline_stacked.html'
|
default_template = 'admin/edit_inline_stacked.html'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user