Hi,

I have a textfile full of event data that I'm trying to parse into the
associated postgresql db via django.  Wrote a simple load.py script I
can run via shell. Being going well though I've stumbled when
importing DateField and TimeField values.

the relevant bits of the code that processes the .txt file runs like
this:

for line in fi:
        event = line.split('~')
        time = event[7].replace(".", ":") +":00"

Which gives me a string along lines of "12:00:00" - what I wanted...

...but this throws an error against TimeField:

"ValidationError: Enter a valid time in HH:MM[:ss[.uuuuuu]] format."

So what do I need to do to the string before it will validate? I have
a feeling its because it is a string being passed, not integer value?

Any help appreciated!

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