On 10/20/07, Ariel Mauricio Nunez Gomez
<ingenieroariel gmail.com> wrote:
> <field type="NoField"
name="point">POINT ( 31.0089240000000004
...
> That NoField type, is it ok?
Well, it depends what you're going to do with it.
That 'NoField' comes from
django.db.models.fields.Field.get_internal_type. It was
originally
used during table creation (as in manage.py syncdb) and
introspection.
It is also included when serializing objects (as the REST
interface
does), but it appears to be only serving as an annotation
for
convenience-- it's not actually used in deserialization.
The problem you may run into is that there are various types
of GIS
fields, all of which will return NoField. Further, other
custom field
types may return NoField and not actually be GIS fields.
Again, this
doesn't affect Django-proper, but if you need to do
something
intelligent based on the type attribute, you may have
trouble.
...A simple solution to fix Django on this issue isn't
immediately
apparent. I know Malcolm was noodling on improving Field
subclassing,
and this get_internal_type bit is one thing that needs
improvement.
I can tell you that the text value inside the <field
type="NoField".../> for GIS fields is WKT:
http://e
n.wikipedia.org/wiki/Well-known_text
There are libraries for pasting it...
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|