List Info

Thread: Re: RESTful Geodjango




Re: RESTful Geodjango
user name
2007-10-20 13:38:40
That restapi is as easy to configure as promised.

The address /xml/mymodel  now presents an xml list  that looks like:

<;object pk="3710" model=&quot;myapp.mymodel"&gt;
<field type=";CharField&quot; name=";custom_id&quot;>XX-83-297</field>
<field type=";DateTimeField" name=";datetime&quot;>2007-07-27 14:59:18&lt;/field>;
<field type=";NoField&quot; name=";point";>POINT ( 31.0089240000000004 -82.7168659999999960)</field&gt;
<field type=";IntegerField" name=";velocidad&quot;>71</field&gt;
<field to="myotherapp.section"; name=";section&quot; rel="ManyToOneRel">1</field>
<field to="auth.user&quot; name=";responsable" rel="ManyToOneRel">3</field>
</object>

That NoField type, is it ok?

Ariel
PS: Thanks Andreas, and thanks to the geodjango team for your excelent work.

On 10/20/07, Ariel Mauricio Nunez Gomez < ingenieroarielgmail.com">ingenieroarielgmail.com> wrote:
Thanks Justin,

I'll try later and let you know.

Ariel.


On 10/20/07, Justin Bronn < jbronngmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jbronngmail.com > wrote:

I quickly glanced at the django-rest-interface code and I don't see
any reason why it shouldn9;t work. ; There are no plans to combine yet,
though it would be nice to have GeoJSON serializers for the GEOS/OGR
geometry objects.&nbsp; The best way to confirm compatibility is experiment
yourself!

-Justin

On Oct 20, 8:57 am, "Ariel Mauricio Nunez Gomez";
< ingenieroar...gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ingenieroar...gmail.com > wrote:
>; Is it possible/planned to use django-rest-api
>; [1]<http://code.google.com/p/django-rest-interface/>in geodjango
> [2] < http://code.djangoproject.com/wiki/GeoDjango > ?
>
>; Ariel
>
> [1]http://code.google.com/p/django-rest-interface/
>; [2]http://code.djangoproject.com/wiki/GeoDjango



--~--~---------~--~----~------------~-------~--~----~
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://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: RESTful Geodjango
user name
2007-10-20 14:01:12
On 10/20/07, Ariel Mauricio Nunez Gomez
<ingenieroarielgmail.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-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

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