summaryrefslogtreecommitdiff
path: root/apps/projects/views.py
diff options
context:
space:
mode:
authorluxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f>2010-04-04 23:30:30 +0000
committerluxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f>2010-04-04 23:30:30 +0000
commitf8cda18e218cf9849ea7b70fc39b505420c930b9 (patch)
tree43eecea66befb5d84dac316f4ca9de7944855a1b /apps/projects/views.py
parenta1138b560308e043de00c2211293583515def19e (diff)
started work on the 5x5 project, models, views, templates
Diffstat (limited to 'apps/projects/views.py')
-rw-r--r--apps/projects/views.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/projects/views.py b/apps/projects/views.py
new file mode 100644
index 0000000..8103270
--- /dev/null
+++ b/apps/projects/views.py
@@ -0,0 +1,22 @@
+from django.shortcuts import render_to_response,get_object_or_404
+from django.template import RequestContext
+from django.views.generic.list_detail import object_list
+from django.db.models import get_model
+
+
+from projects.models.base import Project
+from projects.models.fiveby import FiveBy
+
+projects = {'5x5':'FiveBy','6x6':'SixBy'}
+
+"""
+Projects by slug
+"""
+def detail(request,slug):
+ name = projects[slug]
+ model = get_model('projects', name)
+ qs = model.objects.filter(status__exact=1)
+ template = 'details/%s.html' %(slug)
+ return object_list(request, queryset=qs, template_name=template,)
+
+