Hi,
fedora 7
django 0.96
DATABASE_ENGINE = 'sqlite3'
maybe its late but DateField is causing me some grief when trying to
load some test data from
the command line (ie: not via admin web).
in model
test_date = models.DateField()
in another python script (run on command line ) that imports the model
and attempts to populate an sqlite
database with lots of entries (test data from ascii file , including
date fields in the format yyyy-mm-dd)
eg: equivalent to
obj.test_date='2007-12-04'
obj.save()
it complains about
raceback (most recent call last):
File "populate_database.py", line 136, in <module>
tr.save()
File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line
223, in save
db_values = [f.get_db_prep_save(f.pre_save(self, True)) for f in
self._meta.fields if not isinstance(f, AutoField)]
File
"/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py",
line 494, in get_db_prep_save
value = value.strftime('%Y-%m-%d')
AttributeError: 'str' object has no attribute 'strftime'
SO, thought I would have to do a
time.strptime('2007-02-23', '%Y-%m-%d') thing in between but did not get
it working.
Suggestions welcome :-)
/F
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---