mirror of
https://github.com/nikdoof/limetime.git
synced 2025-12-20 14:09:24 +00:00
Initial import of codebase
This commit is contained in:
14
app/timer/views.py
Normal file
14
app/timer/views.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.views.generic import ListView
|
||||
from django.utils.timezone import now
|
||||
from timer.models import Timer
|
||||
|
||||
|
||||
class TimerListView(ListView):
|
||||
model = Timer
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super(TimerListView, self).get_queryset()
|
||||
if 'active' in self.kwargs:
|
||||
qs = qs.filter(expiry_datetime__gt=now())
|
||||
return qs
|
||||
|
||||
Reference in New Issue
Block a user