On 18/01/2013 12:55, Anssi Kääriäinen wrote:


On 18 tammi, 13:00, Florian Apolloner <f.apollo...@gmail.com> wrote:
Hi,

On Thursday, January 17, 2013 11:08:01 PM UTC+1, Russell Keith-Magee wrote:

So - while I'm not sure there's a place for this in core (unless you can
demonstrate how to implement range types on other backends), it should be
*possible* to use this library as a third party extension. If there is any
interface or refactoring that that can be done to the database backend API
that would make this possible, I'm definitely open to making those changes.

 From what I know Anssi is already working in that area to allow fields to
specify custom filters etc (with the goal to support stuff like
jsonfields/hstore/arrays). Not sure if there is any public code somewhere
already though.

Yes, I have done some work already, discussions & ticket at:
https://code.djangoproject.com/ticket/16187. The code is still in a
stage where I am trying to figure out the correct design.

Currently the basic design is that we have Lookup objects which have
some methods needed for preparing the data and producing SQL. And,
then Field gets a new get_lookup() method where one can return
different Lookup objects for different lookup names.

The goal is to support things like nested json lookups. Another goal
is to have complete support for old-style custom lookups for the
deprecation period. I think I have achieved this - the GIS backends
passes all tests without any changes to it. To achieve this the patch
essentially contains both the new and old lookup code in parallel
(yes, it is ugly, but it seems to work).

For examples of how to define lookups, see:
https://github.com/akaariai/django/compare/ticket_16187_new#L13L72 and
the Lookup object itself at 
https://github.com/akaariai/django/compare/ticket_16187_new#L6R50.
Warning about the code - it will likely contain totally misleading

Looks like it can definitely be used, I'll give it a try


--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to