Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:17:01+00:00 2026-06-13T23:17:01+00:00

Using django non-rel 1.3 with MongoDB as the DB backend: I’m trying to setting

  • 0

Using django non-rel 1.3 with MongoDB as the DB backend:

I’m trying to setting a filter on a field (CharField) of MyModel class, in the corresponding django ModelAdmin class, like this:

class MyModelAdmin(admin.ModelAdmin):
list_filter = ('myfield',)

but what i get is:

TemplateSyntaxError at /admin/myapp/mymodel

Caught DatabaseError while rendering: This query is not supported by the database.

It seems that Django MongoDB engine doesn’t support filter, but i don’t find documentation about.

EDIT:
The error comes from template file …/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 %}

My model is:


class MyModel(models.Model):
myfield=models.CharField(max_length='300')

and my admin model is:

class MyModelAdmin(admin.ModelAdmin):
list_filter = ('myfield',)

and register it with:


admin.site.register(MyModel, MyModelAdmin)
.

Debugging the code, the exception is throwed by method check_query of basecompiler.py. This method verifies that self.query.distinct or self.query.extra or self.query.having is true and then throws the exception (self.query.distinct is equal to ‘True’ in the interested query object, so the cause is this).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:17:02+00:00Added an answer on June 13, 2026 at 11:17 pm

    The error occurs because Django Admin’s list_filters use a distinct() when trying to figure out which members belong in the list.

    Our (internal, hacky) solution was to patch django non_rel to make the distinct call happen in memory rather then on the DB end. This is by no means the ‘correct’ solution, and we haven’t made a point of testing it in use cases other then ours, but it’s better than nothing.

    YMMV.

    https://github.com/BlueDragonX/django-nonrel/commit/4025327efbe5c17c6b77e0497c2b433819c42918

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using django non-rel ( http://www.allbuttonspressed.com/projects/django-nonrel ) and am trying to delete all the
I am using Django non-rel version with mongodb backends. I am interested in tracking
I am using Django Non-rel and Django-MongoDB ORM for my project with MongoDB Nosql
I'm using django-non rel for the first time. I already had a simple django
I'm developing an application on Google App Engine using the current django non-rel and
I'm using the django-mongodb-engine, django-nonrel, djangotoolbox projects / packages to get django talking with
I'm using the Django ORM in a non-Django application and would like to turn
Using Django 1.1, I am trying to select the maximum value from a varchar
My application uses Django non-rel . I don't have access to model. I have
I am using django-nonrel and django-mongodb-engine I have a Django model stored on PostgreSQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.