On 7/14/07, Etienne Robillard <[EMAIL PROTECTED]> wrote:
>
> Hi Russell,
>
> Thanks for responding to this thread. You were right
> for the data not matching the model. The assumption that
> some_model_instance.__dict__.keys() would return the fields names
> is simply wrong. :)

You can get the list of model fields from:

some_model_instance._meta.fields

and

some_model_instance._meta.many_to_many

This gives you the Field instance, which can tell you the field name,
the data type, and provides handles for some datatype conversion
(e.g., string to Python type, via to_python).

> The issue is that it returns some ProgrammingErrors like:
...
> ProgrammingError: invalid input syntax for integer: "0.1"
> </snip>

Looks like your data file contains a value of "0.1", but the field
says it should be an integer. 0.1 isn't an integer, so Django throws
an error.

> I dont know if this thread should be in django-users, but my apologies
> if this isnt the appropriate list for posting :)

This is not a discussion of how to fix/improve Django itself, so
django-users is the right forum.

Yours,
Russ Magee %-)

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