On Jun 17, 6:40 am, Sheena <sheena.oconn...@gmail.com> wrote:
> Thanks
>
> The question is how do I populate a field with some other date, for
> example, there's a date of birth field that the auto stuff wont be
> ideal for...
> In the populate method i mentioned before, i passed the dob(date of
> birth) field a Date object initialized to something arbitrary. Does
> the DateField not get along with standard date objects? What format
> should stuff be in for populating DateFields?
For some reason you're trying to set the value of your date fields to
a *field*. Just as with any other field, you need to set the value of
the field to the corresponding value - for a charfield, you would set
it to a string:
   self.mycharfield = "mystring"
and for an integer you would do:
   self.myintegerfield = 1
so for a date field you just set it to a date:
    self.mydatefield = datetime.date.today()

--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to