14 lines
310 B
Python
14 lines
310 B
Python
|
from psycopg2.extras import DateTimeTZRange
|
||
|
|
||
|
from django.db.models import QuerySet
|
||
|
from django.utils import timezone
|
||
|
|
||
|
|
||
|
class TicketTypeQuerySet(QuerySet):
|
||
|
|
||
|
def available(self):
|
||
|
now = timezone.now()
|
||
|
return self.filter(
|
||
|
available_in__contains=DateTimeTZRange(now, None)
|
||
|
)
|