Marco, this is great. I wonder if it would be possible to add range fields without modifying django?
On Monday, December 31, 2012 8:56:12 PM UTC+11, mpaolini wrote: > > Hi all, > > sorry for the noise, forget my previous mail as it was pointing to the > wrong commit, > here's the good one: > > > https://github.com/mpaolini/django/commit/b754abdeab204949510500ccb1b845b7ad143542 > > > copying here the rest of the original mail: > > postgresql since version 9.2 added support for range types [1] > they have a nice set of specialized operators like "overlaps", "left of", > etc... [2] > > So I decided to work on a reference implementation for Django > even if it looks like psycopg2 does not fully support yet these data types > [3] > > The implementation is only a proof of concept and is not complete and not > tested > (but it does contain tests, of course!) > > I did: > - datetime range python data type: two bounds plus inclusive/excusive > info (very basic!) > - datetime range model field > - range specific lookups for querysets > - non-overlapping constraint: db-level enforced with sql CONSTRAINT and > model validation > - some documentation > > TODO: > - form, widget, modelform, localization, admin > - more range types (int, bigint, etc...) > - more validation against invalid ranges > - better range type python implementation > - more testing > > Do you like it? Any chances for it to land in master once it is completed? > Or is it too specialized? > > Cheers, > > Marco > > [1] http://www.postgresql.org/docs/9.2/static/rangetypes.html > [2] > http://www.postgresql.org/docs/9.2/static/functions-range.html#RANGE-OPERATORS-TABLE > > [3] http://archives.postgresql.org/psycopg/2012-09/msg00051.php > > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/EXxINLYk-hgJ. 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.