Re: Selecting overlapping elements from ArrayField of DateTimeRangeField

2017-05-19 Thread user0008
I answer to my own question. It can't be done :-) The solution needs raw SQL query + subquery (eg. using JOIN LATERAL: https://dba.stackexchange.com/questions/147129/selecting-only-overlapping-elements-from-array-of-ranges ) W dniu czwartek, 18 maja 2017 12:58:35 UTC+2 użytkownik user0008

Selecting overlapping elements from ArrayField of DateTimeRangeField

2017-05-18 Thread user0008
Hello all! I'm trying to flter query that returns rows from the table along with only elements from the ArrayField that overlap a specified DateTimeTZRange. Example: import datetime from psycopg2.extras import DateTimeTZRange from django.db import models from django.contrib.postgres.fields