tickets: 8292
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8292 | 2008-08-13 20:34:04 | 2011-09-28 16:12:17 | 2022-03-06 03:41:52.071525 | Accepted | closed | contrib.admin | dev | fixed | InlineModelAdmin not honoring filter_horizontal | One would expect the `filter_horizontal` / `filter_vertical` admin options to function with the `InlineModelAdmin` classes for generic relationships `in contenttypes.generic`. Considering the code snippet below, I would have expected the nice javascript dual-picklist interface instead of the plain, single multiselect input. Sample models.py file: {{{ #!python from django.db import models from django.contrib.auth.models import User from django.contrib import admin from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType class GenericDocument(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(User, blank=True) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey() class Publisher(models.Model): name = models.CharField(max_length=50) articles = generic.GenericRelation(GenericDocument) class GenericDocumentInline(generic.GenericStackedInline): model = GenericDocument filter_horizontal = ('authors', ) class PublisherAdmin(admin.ModelAdmin): list_display = ('name', ) inlines = [GenericDocumentInline] admin.site.register(Publisher, PublisherAdmin) }}} | brosner | dakrauth | 0 | 0 | 0 | 0 | 0 | 0 |