django-mongoadmin icon indicating copy to clipboard operation
django-mongoadmin copied to clipboard

Support for Django 1.4 new FilterSpec

Open jschrewe opened this issue 13 years ago • 2 comments

This is at the moment patched to work just like it did in Django 1.3. The current fix is in views.py#55-60.

See release notes https://docs.djangoproject.com/en/dev/releases/1.4/#list-filters-in-admin-interface

jschrewe avatar Mar 29 '12 21:03 jschrewe

it seems filter doesnt works, i have 'ReferenceField' object has no attribute 'rel' on any filter

pip freze

mongoadmin==0.1.3
mongodbforms==0.1.5
mongoengine==0.6.9
pymongo==2.3

models

class City(Document):
    title = StringField(required=True, unique=True)

    def __str__(self):
        return self.title

class Category(Document):
    title = StringField(required=True, unique=True)
    city = ReferenceField(City, reverse_delete_rule=CASCADE, required=True)

    def __str__(self):
        return self.title

admin

class CategoryAdmin(DocumentAdmin):
    search_fields = ('title', )
    list_filter = ('city', )

hellysmile avatar Sep 10 '12 21:09 hellysmile

Okay better late then never I guess. The rel attribute thing is fixed. The list_field with reference field won't fix though. Sorry, see the addition to the readme about the why.

jschrewe avatar Jun 28 '13 00:06 jschrewe