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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:30:16+00:00 2026-06-04T05:30:16+00:00

I edited a model in django and as a result I get the error:

  • 0

I edited a model in django and as a result I get the error: “table reserve_time has no column named reservation” for the below models:

from django.db import models
import datetime

class Club(models.Model):
    establishment = models.CharField(max_length=200)
    address = models.CharField(max_length=200)
    def __unicode__(self):
        return self.establishment

class Day(models.Model):
    club = models.ForeignKey(Club)
    day = models.DateField('day')
    def __unicode__(self):
        return unicode(self.day)

class Court(models.Model):
    club = models.ForeignKey(Club)
    day = models.ForeignKey(Day)
    court = models.IntegerField(max_length=200)
    def __unicode__(self):
        return unicode(self.court)

class Time(models.Model):
    club = models.ForeignKey(Club)
    day = models.ForeignKey(Day)
    court = models.ForeignKey(Court)
    time = models.TimeField('time')
    reservation = models.CharField(max_length=200)
    def __unicode__(self):
        return unicode(self.time)

I ran python manage.py syncdb and python manage.py runserver after, but I still get the above error. Any ideas on how to fix this? If I remove the “reservation” field, it works fine. In the admin, the textbox for “reservation” appears but the error comes up when I try save.

  • 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-04T05:30:18+00:00Added an answer on June 4, 2026 at 5:30 am

    The problem here is that django will not do anything to fix your tables when you make field changes. All syncdb will do is create tables that do not already exist. If you decide to change your schema and add fields, you either need to create them manually in your database, or drop the table and let syncdb recreate it, or start using a project like South to handle database migrations.

    The reason this cannot work is because you would already theoretically have existing records in the table, and there is no sure way to know what you do with all those missing fields. Maybe these fields cannot be null. Maybe they have other constraints that must be satisfied. Apparently South can manage this situation.

    Update (Dec. 2019)

    It has been over 7 years since I have used django, but it seems that nowadays the database migration functionality has been integrated as a first class concept:
    https://docs.djangoproject.com/en/3.0/topics/migrations/

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

Sidebar

Related Questions

NOTE: Edited to add the Model The Problem: a querystring guid value is giving
I have the following in models.py: class Choices(models.Model): description = models.CharField(max_length=300) def __unicode__(self): return
I trying to return the same model back to the view that edited the
I have a object in a model date_created = models.DateTimeField(auto_now=True) Now this saves the
I want to model an article with revisions in Django: I have following in
I'd like to perform a check when saving a model via the django Admin
I am struggling with Core data. I get the infamous error Failed to call
My django application has some 500 records in various tables in the database( postgres
[EDITED: I left the original question below, with some more context and code to
how to log model inserts,updates and deletes? I am not using django admin,in my

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.