> Got 2 datetime fields in a model, like this:
>
> proposed_time = models.DateTimeField(default=datetime.now())
> accepted_time = models.DateTimeField(blank=True, null=True)
>
> The default value for proposed_time works fine.
>
> Can't get accepted_time to save, either from admin or views.
> No errors, it just does not save the value - the value in the database
> remains NULL.
>
> Likewise if I try to change the value of proposed_time from admin, it
> does not get saved.
You have been bitten by "modifiable default arguments" feature of
python - defaults are evaluated at module compilation time, not at
code execution. Use default=datetime.now (a callable, not value).
But I have no clue as to not-saving field value.
--
We read Knuth so you don't have to. - Tim Peters
Jarek Zgoda
jarek...@redefine.pl
\d