Re: Form initial data is not dynamic

2010-03-05 Thread NaMaK
Ah. That does make sense! I cant believe I missed that in the docs. Thanks for pointing it out! On Mar 5, 7:08 am, David De La Harpe Golden wrote: > On 05/03/10 01:30, NaMaK wrote: > > class DateTest(forms.Form): > > ...    

Re: Form initial data is not dynamic

2010-03-05 Thread David De La Harpe Golden
On 05/03/10 01:30, NaMaK wrote: class DateTest(forms.Form): ... in_date=forms.DateTimeField(initial=datetime.datetime.now()) ... Well, note that the now() was executed when python first saw it, which was just a bit after it first saw the class definition. Think about it - it does make

Form initial data is not dynamic

2010-03-04 Thread NaMaK
Hi, I am using Django 1.1. When I create a form, the initial data is set when the class is created. It does not get updated when an object is created. The following can demonstrate: >>> >>> import datetime >>> from django import forms >>> >>> datetime.datetime.now() datetime.datetime(2010, 3, 4,