List Info

Thread: Time field issues




Time field issues
user name
2006-06-28 10:11:22
Hi Folks,

I've just tried to add a time field to one of my models,
and then I
ran:

ALTER TABLE blah ADD COLUMN blah_blah TIME;
UPDATE blah SET blah_blah='09:00:00'

I restarted apache, and I can see my current entries are
showing 9am
correctly in the new "blah_blah" field, but when
I try to add a new
entry into the "blah" table I get the following
error:

AttributeError at /admin/runsheets/item/add/
'str' object has no attribute 'strftime'
Request Method:         GET
Request URL:    http://e
xample.com/admin/runsheets/item/add/
Exception Type:         AttributeError
Exception Value:        'str' object has no attribute
'strftime'
Exception Location:

/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/djang
o/db/models/fields/__init__.py
in flatten_data, line 750

Any ideas what's happening here?

Thanks, Tom


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Time field issues
user name
2006-06-28 13:12:08
Turns out it's because I had "default='09:00' in my
model. I guess it
needs a time entry, not a string entry.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )