Extensions support concept and geo extension example

41 views
Skip to first unread message

svartalf

unread,
Jan 10, 2013, 8:05:38 PM1/10/13
to django-res...@googlegroups.com
Hello!

I'm interested in the geodjango support for a rest_framework, and I had found this topic with an idea of separated app for that: https://groups.google.com/forum/?fromgroups=#!searchin/django-rest-framework/geo/django-rest-framework/nNtqhK78MiI/mCCCr_AiRecJ

I think that flask' way for extensions (http://flask.pocoo.org/docs/extensiondev/) is pretty enough, so I had made a little proof-of-concept for a extensions support and a simple geo extension.


What do you think about all of that?

Tom Christie

unread,
Jan 11, 2013, 8:02:12 AM1/11/13
to django-res...@googlegroups.com
Hiya,

  I'm not sure I really understand the need for the extensions bit.  From a quick look that just seemed to be a hack to be able to do `from rest_framework.ext import foobar`, instead of just using `import foobar`.  I haven't seen the pattern used in any other Django projects, so at least an initial opinion would be, that's a flask convention that we don't really need.

  The geodjango support however would be *great*.  I don't think there's anything to stop you building everything you need as a third party package, available on PyPI.  If that's something you're interested in doing I'd be happy to provide review and support for getting that done, and to link to the package from the main docs, in the same way that we now do for Juan Riaza's MessagePack package

Cheers,

  Tom

svartalf

unread,
Jan 11, 2013, 8:10:14 AM1/11/13
to django-res...@googlegroups.com
I just thought that it will be more clear, if extension will be imported from the framework sub-package, instead of a different packages list. "Namespaces are one honking great idea", you know.

Well, I'm still interested in the geo support, so I'll continue working on the code. Some kind of a code review is also will be awesome, thanks.

Jani Tiainen

unread,
Jan 11, 2013, 8:44:30 AM1/11/13
to django-res...@googlegroups.com
I would be more than happy to have geodjango support in restframework.
Because about all my apps rely heavily on geodjango.

I'm just thinking that what would it mean?

By looks of that sample implementation it's rather naive and to me it
seemed to contain a bit of questionable coding practices.

11.1.2013 15:10, svartalf kirjoitti:
> I just thought that it will be more clear, if extension will be imported
> from the framework sub-package, instead of a different packages list.
> "Namespaces are one honking great idea", you know.
>
> Well, I'm still interested in the geo support, so I'll continue working
> on the code. Some kind of a code review is also will be awesome, thanks.
>
> On Friday, January 11, 2013 10:02:12 PM UTC+9, Tom Christie wrote:
>
> Hiya,
>
> I'm not sure I really understand the need for the extensions bit.
> From a quick look that just seemed to be a hack to be able to do
> `from rest_framework.ext import foobar`, instead of just using
> `import foobar`. I haven't seen the pattern used in any other
> Django projects, so at least an initial opinion would be, that's a
> flask convention that we don't really need.
>
> The geodjango support however would be *great*. I don't think
> there's anything to stop you building everything you need as a third
> party package, available on PyPI. If that's something you're
> interested in doing I'd be happy to provide review and support for
> getting that done, and to link to the package from the main docs, in
> the same way that we now do for Juan Riaza's MessagePack package
> <http://django-rest-framework.org/api-guide/parsers.html#messagepack>.
>
> Cheers,
>
> Tom
>
> On Friday, 11 January 2013 01:05:38 UTC, svartalf wrote:
>
> Hello!
>
> I'm interested in the geodjango support for a rest_framework,
> and I had found this topic with an idea of separated app for
> that:
> https://groups.google.com/forum/?fromgroups=#!searchin/django-rest-framework/geo/django-rest-framework/nNtqhK78MiI/mCCCr_AiRecJ
> <https://groups.google.com/forum/?fromgroups=#!searchin/django-rest-framework/geo/django-rest-framework/nNtqhK78MiI/mCCCr_AiRecJ>
>
> I think that flask' way for extensions
> (http://flask.pocoo.org/docs/extensiondev/
> <http://flask.pocoo.org/docs/extensiondev/>) is pretty enough,
> so I had made a little proof-of-concept for a extensions support
> and a simple geo extension.
>
> django-rest-framework changes:
> https://github.com/svartalf/django-rest-framework/commit/ac6d7ace48a4227b7265a7cf19da89be40ba46fd
> <https://github.com/svartalf/django-rest-framework/commit/ac6d7ace48a4227b7265a7cf19da89be40ba46fd>
> And an example of the extension:
> https://github.com/svartalf/django-rest-framework-geo
> <https://github.com/svartalf/django-rest-framework-geo>
>
> What do you think about all of that?
>


--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

svartalf

unread,
Jan 11, 2013, 8:55:03 AM1/11/13
to django-res...@googlegroups.com
Hi, Jani!

I should note that "django-rest-framework-geo" is just an example of extensions concept, which was described in the first message. A lot of work still should be done for a full-grown geodjango support.

Also, I'm very interested, which part of code contains those questionable coding practices?

Douglas Meehan

unread,
Feb 5, 2013, 12:33:34 PM2/5/13
to django-res...@googlegroups.com, se...@svartalf.info
I've started a Geodjango support app for Rest Framework here:


Current contains a very basic GeometryField and a GeoModelSerializer.

Let me know if you are interested in collaborating.
Reply all
Reply to author
Forward
0 new messages