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

  • Home
  • SEARCH
  • 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 6646061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:22:12+00:00 2026-05-26T00:22:12+00:00

First my django model was like this: class List(Document): owner = ReferenceField(‘User’) name =

  • 0

First my django model was like this:

class List(Document):
    owner = ReferenceField('User')
    name = StringField()
    users = ListField(ReferenceField('User'))
    created_at = DateTimeField(default=datetime.datetime.now)

After I added a new filed is_cancelled and now it is like that:

class List(Document):
    owner = ReferenceField('User')
    name = StringField()
    users = ListField(ReferenceField('User'))
    created_at = DateTimeField(default=datetime.datetime.now)
    is_cancelled = BooleanField(default = False)

I use mongoengine for django mongodb ORM. But now when i want to make a filter query:

List.objects.filter(is_cancelled=False)
returns []

I make all is_cancelled fields to False with django object:

for x in List.objects.all():
    x.is_cancelled = False
    x.save()

But I’m still getting an empty list for the query above.
I’m looking a django objects’ is_cancelled filed and I see is_cancelled = False

l = List.objects.all()[0]
l.is_cancelled

False

But when I look from mongodb shell. There is no filed as is_cancelled.

db.list.find()
{ "_cls" : "List", "_id" : ObjectId("4e8451598ebfa80228000000"), "_types" : [ "List" ],     
"created_at" : ISODate("2011-09-29T16:24:28.781Z"), "name" : "listname", "users" : [          
{
            "$ref" : "user",
            "$id" : ObjectId("4e79caf78ebfa80c00000001")
    },      {
            "$ref" : "user",
            "$id" : ObjectId("4e79e4df8ebfa80b64000001")
    },      {
            "$ref" : "user",
            "$id" : ObjectId("4e7aeb898ebfa80b64000001")
    },      {
            "$ref" : "user",
            "$id" : ObjectId("4e79ce028ebfa80c00000004")
    } ] }    

How can I fix this query

  • 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-05-26T00:22:12+00:00Added an answer on May 26, 2026 at 12:22 am

    Voila!

    This is my answer:

    https://github.com/hmarr/mongoengine/issues/282

    There is a bug at the mongengine BooleanField with a value of False.

    But they have fixed it with this patch:

    https://github.com/hmarr/mongoengine/pull/283

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

Sidebar

Related Questions

I have a Django model that looks something like this: class Person(models.Model): name =
I have this models in Django class Country(models.Model): name = models.CharField(max_length=80) class Person(models.Model): first_name
I'm making a weblog site in Django. I have a Blog model like this:
My model is like below: class Manufacturers(models.Model): name = models.CharField() class Phones(models.Model): manufacturer =
I have the following model: from django.db import models class State(models.Model): name = models.CharField(max_length=30)
Let's take the Django tutorial. In the first part we can find this model:
I have this model: class People(models.Model): name = models.CharField(max_length=128, db_index=True) friends = models.ManyToManyField('self') So
I have a custom property on my Django model that returns the full name
I have a complex django object, which has properties of other class types. This
I have a situation like this: there are three Django models, let's call them

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.