dave.l wrote: > I have a model as follows: > > class Building(meta.Model): > survey_date = meta.DateField(null=True) > check_date = meta.DateField(null=True, blank=True) > researcher = meta.ForeignKey(Researcher) > .... > > I was hoping that this would let me have a blank check_date (which > would be stored as null) but enforce entry of a survey_date. But from > my admin page if I enter a survey_date (but leave the check_date blank) > I get the following on Save: > > OperationalError at /admin/coils/buildings/add/ > (1048, "Column 'check_date' cannot be null") > Request Method: POST > Request URL: http://81.3.86.154:8000/admin/coils/buildings/add/ > Exception Type: OperationalError > Exception Value: (1048, "Column 'check_date' cannot be null") > Exception Location: > /usr/lib/python2.3/site-packages/MySQLdb/connections.py in > defaulterrorhandler, line 32 > > What have I missed?
This is a constraint in the database that is complaining, which means that your table in the database is not the same as the Model you provided (most likely because you made the above change after an install/sync). -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---