On Tue, May 13, 2008 at 7:01 AM, sam <[EMAIL PROTECTED]> wrote:

> hello,
>
> i'm looking for a way to authorize user to add date like '2007-00-00',
> or '2004-04-00', when he doesn't know precisely the day or the day and
> the month of a date.
>
> is someone has got a way to do this ?
>

This is hard to do using a DateField directly, because Python does not
support incompletely specified dates.  Just try to create a
datetime.date(2007,0,0) and you'll see.  So, even if your database supports
putting values like this into a date field (I'm not sure which ones do, I
know MySQL does), on retrieval you've got a problem because there's no way
to represent the value as a Python datetime.date object.

So, you need something like a "fuzzy" DateField, as described here:

http://blog.elsdoerfer.name/2008/01/08/fuzzydates-or-one-django-model-field-multiple-database-columns/

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to