Django

Code

Ticket #4761 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

AttributeError (no filter_vertical at TabularInline or StackedInline)

Reported by: anonymous Assigned to: adrian
Milestone: Component: Forms
Version: newforms-admin Keywords: inline admin newforms
Cc: eduardo.padoan@gmail.com Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Example:

class BlogOptions(admin.ModelAdmin):
    list_display = ('title', 'number_of_entries')
    inlines = [admin.TabularInline(Entry, extra=2)]
    prepopulate_fields = {'slug': ('title', 'subtitle')}

admin.site.register(Blog, BlogOptions)

Url admin/app/blog/add/ gives:

AttributeError at /admin/blogfarm/blog/add/
'TabularInline' object has no attribute 'filter_vertical'

it points to the line 112:

 111. # For ManyToManyFields with a filter interface, use a special widget.
 112. if isinstance(db_field, models.ManyToManyField) and db_field.name in (self.filter_vertical + self.filter_horizontal):
 113.     kwargs['widget'] = widgets.FilteredSelectMultiple(db_field.verbose_name, (db_field.name in self.filter_vertical))
 114.     return db_field.formfield(**kwargs)

Got the same error working for StackedInline?.

Both Blog and Entry have ManytoManyFields?.

Using revision #5596 of the newforms-admin branch.

Attachments

Change History

07/03/07 22:16:04 changed by anonymous

  • cc set to eduardo.padoan@gmail.com.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

08/30/07 00:33:46 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [6025]) newforms-admin: Fixed #4761 -- Moved default definition of filter_horizontal and filter_vertical so that inline edits work with M2M fields.


Add/Change #4761 (AttributeError (no filter_vertical at TabularInline or StackedInline))




Change Properties
Action