On Sat, 2009-03-14 at 21:51 -0700, kpeters wrote: > default (see active field) does not seem to propagate - see below > (Postgres 8.3.6 - current Django as of yesterday) > > Any ideas?
That's normal behaviour; Django has never set up the default value on the database column. There are at least a couple of reasons for this behaviour. (1) From day one, Django was able to operate over existing database tables. A default value that makes sense for a web-based operation and might therefore use Django, doesn't necessarily make sense for all data in the database (or all processes that will be populating that database table). So the default at the database level can legitimately be different than the default at the Django level. (2) The documentation for the default option mentions that the default can be a callable, which is called *each* time. You can't write that as a database option. Each of these could be done as a special case (send a default unless...), but Django is being consistent here. If you recreate the database from the model, you'll get something that is more or less identical to what's in the database now (each time you do that). You assumed that the "default" parameter specified a database-level constraint. That's not true. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---