On Aug 28, 3:01 pm, Greg Taylor <[EMAIL PROTECTED]> wrote:
> I'm getting the following error on some of my models with
> DateTimeFields. Any ideas?
>
> Traceback (most recent call last):
>
... snip. ...
>
>  File "/home/clemsoncrew/site-packages/django/forms/widgets.py", line
> 662, in decompress
>    return [value.date(), value.time().replace(microsecond=0)]
>
> AttributeError: 'datetime.date' object has no attribute 'date'

This probably means that somewhere in your code you've done "from
datetime import datetime" rather than just "import datetime".
Annoyingly and confusingly, both the module and one of its classes are
called datetime. The *module* 'datetime' does have an attribute called
'date', but the *class* 'datetime' does not.

Basically, unless you have a very good reason, you should always use
"import datetime".
--
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-users@googlegroups.com
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