I am trying to switch over to using MongoDB with Django, but have run into an issue. Namely, some parts of the site give a 'DatabaseError at /admin/myApp/myModel: This query is not supported by the database.' As described by the similar question posted here, this error arrises from .../admin/templates/change_list.html, and the line that throws it is line 85:
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
I have several models, containing a variety of CharFields, IntegerFields, BooleanFields, DateFields, URLFields, and DecimalFields. There is also a ManyToManyField:
class Trail(models.Model):
sections = models.ManyToManyField(TrailSection)
I have had no problems with users, etc, but whenever I try to access the Trail model, I get the above error. There are no problems when I click on the TrailSection part of the /admin page, but this error appears when I click on Trail. It is ok to call
associatedTrails = Trail.objects.filter(sections=sect).order_by('-date').values('trail_id','name')
but I get the error when I later use
for t in associatedTrails:
The other question on StackOverflow documents this error as a bug that needs to be fixed, but my question is this: Why does this only happen sometimes? Why is there no problem with TrailSections or other /admin pages, but this one throws an error? Is there a good way to fix it?