jschrewe / django-mongoadmin

Integrates mongodb into django's admin
http://www.schafproductions.com/projects/mongo-admin/
BSD 3-Clause "New" or "Revised" License
112 stars 38 forks source link

Support for Django 1.4 new FilterSpec #5

Open jschrewe opened 12 years ago

jschrewe commented 12 years ago

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

hellysmile commented 12 years ago

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', )
jschrewe commented 11 years ago

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.