On Tue, Aug 28, Greg wrote:

> 
> Hello,
> I have the following code in my models.py file
> 
> class Orders(models.Model):
>     timestamp = models.DateField()
>     ... etc
> 
> /////////////
> 
> I have the following in my view.py function
> 
> from datetime import datetime
> o = Orders()
> o.timestamp = datetime.now()
> ... etc
> o.save()
> 
> ////////////
> 
> However, when I view this order in the admin I get the following
> error:
> 
> AttributeError at /admin/rugs/orders/13/
> 'unicode' object has no attribute 'strftime'
> 
> Does anybody know what's going on?

Do you use Mysql? I made the weird experience that MySQLdb sometimes returns
a string instead of datetime.datetime. It seemed to happen deep in either
MySQLdb or even the client library of mysql. (Mysql 4.1)

Michael

-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The IT-Outsourcing Company
 
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - 
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689

--~--~---------~--~----~------------~-------~--~----~
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