Hi all, 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 squashed the whole thing into this single commit: https://github.com/mpaolini/django/commit/e0a1a056a735857719f2faf50ec5e0b28c10d078 and the tests in this other commit: https://github.com/mpaolini/django/commit/e50933f46881e1802ca1ad89f2587c0ec46d76d8 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 post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
