summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/gtd/models.py6
-rw-r--r--app/gtd/views.py9
2 files changed, 6 insertions, 9 deletions
diff --git a/app/gtd/models.py b/app/gtd/models.py
index e3d49ce..af6ca69 100644
--- a/app/gtd/models.py
+++ b/app/gtd/models.py
@@ -44,9 +44,9 @@ class GTDOutcome(models.Model):
class GTDProject(models.Model):
PROJECT_TYPE = (
- (0, 'Wired'),
+ (0, 'wired'),
(1, 'lbh'),
- (2, 'Personal'),
+ (2, 'personal'),
(3, 'lxf'),
)
title = models.CharField(max_length=200)
@@ -168,7 +168,7 @@ class WiredPost(models.Model):
return self.title
def time_since_update(self):
- td = timezone.localdate() - self.date_last_pub
+ td = datetime.date.today() - self.date_last_pub
return int(td.days)
#def get_needs_update(self):
diff --git a/app/gtd/views.py b/app/gtd/views.py
index fc96187..a3b7eab 100644
--- a/app/gtd/views.py
+++ b/app/gtd/views.py
@@ -97,15 +97,12 @@ class GTDProjectListView(ListView):
model = GTDProject
template_name = "gtd/project_list.html"
- def get_queryset(self):
- print("hello world")
- print(self.kwargs['project_type'])
+ def get_queryset(self, *args, **kwargs):
if self.kwargs['project_type']:
project_type_reverse = dict((v, k) for k, v in GTDProject.PROJECT_TYPE)
- project_type = project_type_reverse[self.kwargs['project_type'].title()]
+ project_type = project_type_reverse[self.kwargs['project_type']]
return GTDProject.objects.filter(project_type=project_type)
- context = super(GTDProjectListView, self).get_context_data(**kwargs)
- return context
+ return GTDProject.objects.all()
def get_context_data(self, **kwargs):
context = super(GTDProjectListView, self).get_context_data(**kwargs)