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 8889953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:23:21+00:00 2026-06-14T22:23:21+00:00

I have a model: class mymodel(models.Model): order_closed = models.BooleanField(default=False) I added this field to

  • 0

I have a model:

class mymodel(models.Model):
    order_closed = models.BooleanField(default=False)

I added this field to my development mysqllite db manually since its a new field for a model/table that already existed. I then tried:

mymodel.objects.filter(order_closed=False) #and with True

and its producing incorrect or unpredictable results. I saw some mention that is could be a sqllite thing but I’m not sure? The templates seem to understand whether its a true or false value but python code doesn’t. To clarify with some examples:

{{mymodel.order_closed}} will print 0 after I set the default to 0 in sqllite. but using .filter(order_closed=value) will still return every record.

  • 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-14T22:23:23+00:00Added an answer on June 14, 2026 at 10:23 pm

    I think you make some mistake in wrirting SQL . If you have db which have some important informations use

    south
    

    http://south.aeracode.org/

    When you will have it you can easly upgrate/edit your database .

    If you dont wanna install new ‘plugins’ try that .
    1. Delete this field from DB manualy .
    2. write : python manage.py sql ‘name of app’

    It will return the CREATE TABLE SQL statements for the app.

    Then you can upr your database manualy with some of CReate command.

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

Sidebar

Related Questions

I have a model with a datetime field: class MyModel(models.Model): created = models.DateTimeField(auto_now =
I have a model: class MyModel(models.Model): id = models.IntegerField(primary_key=True) recorded_on = models.DateField() precipitation =
in a Model I have a CharField with choices: class MyModel(models.Model): THE_CHOICES=( ('val',_(u'Value Description')),
I have a model similar to this: public class myModel { public ClassA ObjectA
I have a simple Python/Django class: class myModel(models.Model): date = models.DateTimeField() value = models.IntegerField()
I have a class model somewhat like this: public class MyModel { long MyModelID
I have the following in my model: class info(models.Model): add = models.CharField(max_length=255) name =
I have a standard ActiveRecord model with the following: class MyModel < ActiveRecord::Base custom_method
In my MVC 4 project, I have a Model like: public class MyModel {
I have this: class OrderForm(ModelForm): class Meta: model = Order exclude = ('number',) def

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.