mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
newforms-admin: Changed ModelAdmin.get_field_sets() so that it doesn't take an opts argument
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2ea6cdbd9d
commit
13da9d7d2f
@ -112,8 +112,9 @@ class ModelAdmin(object):
|
||||
else:
|
||||
return self.change_view(request, unquote(url))
|
||||
|
||||
def get_field_sets(self, opts):
|
||||
def get_field_sets(self):
|
||||
"Returns a list of AdminFieldSet objects."
|
||||
opts = self.opts
|
||||
if self.fields is None:
|
||||
field_struct = ((None, {'fields': [f.name for f in opts.fields + opts.many_to_many if f.editable and not isinstance(f, models.AutoField)]}),)
|
||||
else:
|
||||
|
@ -170,7 +170,7 @@ def render_change_form(model_admin, model, manipulator, context, add=False, chan
|
||||
opts = model._meta
|
||||
app_label = opts.app_label
|
||||
auto_populated_fields = [f for f in opts.fields if f.prepopulate_from]
|
||||
field_sets = model_admin.get_field_sets(opts)
|
||||
field_sets = model_admin.get_field_sets()
|
||||
original = getattr(manipulator, 'original_object', None)
|
||||
bound_field_sets = [field_set.bind(context['form'], original, AdminBoundFieldSet) for field_set in field_sets]
|
||||
first_form_field_id = bound_field_sets[0].bound_field_lines[0].bound_fields[0].form_fields[0].get_id();
|
||||
|
Loading…
x
Reference in New Issue
Block a user