summaryrefslogtreecommitdiff
path: root/todolists
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-03-08 00:13:41 -0800
committereliott <eliott@cactuswax.net>2008-03-08 00:13:41 -0800
commit9b7b5122544283fc32d81d785e94c5f4aacc0109 (patch)
treeba117f7fadc24737920fa4f1b9a711157e629cc5 /todolists
parent7e2d0f2f0cd8f176cf82c02d704ad4fe25a07b3b (diff)
Moved models around
Diffstat (limited to 'todolists')
-rw-r--r--todolists/models.py33
-rw-r--r--todolists/views.py5
2 files changed, 2 insertions, 36 deletions
diff --git a/todolists/models.py b/todolists/models.py
deleted file mode 100644
index ec24d5ed..00000000
--- a/todolists/models.py
+++ /dev/null
@@ -1,33 +0,0 @@
-from django.db import models
-from django.contrib.auth.models import User
-from archweb_dev.packages.models import Package
-
-class TodolistManager(models.Manager):
- def get_incomplete(self):
- results = []
- for l in self.all().order_by('-date_added'):
- if TodolistPkg.objects.filter(list=l.id).filter(complete=False).count() > 0:
- results.append(l)
- return results
-
-class Todolist(models.Model):
- id = models.AutoField(primary_key=True)
- creator = models.ForeignKey(User)
- name = models.CharField(maxlength=255)
- description = models.TextField()
- date_added = models.DateField(auto_now_add=True)
- objects = TodolistManager()
- class Meta:
- db_table = 'todolists'
-
-class TodolistPkg(models.Model):
- id = models.AutoField(primary_key=True)
- list = models.ForeignKey(Todolist)
- pkg = models.ForeignKey(Package)
- complete = models.BooleanField(default=False)
- class Meta:
- db_table = 'todolists_pkgs'
- unique_together = (('list','pkg'),)
-
-# vim: set ts=4 sw=4 et:
-
diff --git a/todolists/views.py b/todolists/views.py
index cce92a6c..59dc5dbf 100644
--- a/todolists/views.py
+++ b/todolists/views.py
@@ -2,9 +2,8 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.models import User
-from archweb_dev.lib.utils import render_response
-from archweb_dev.todolists.models import Todolist, TodolistPkg
-from archweb_dev.packages.models import Package
+from archweb_dev.main.utils import render_response
+from archweb_dev.main.models import Todolist, TodolistPkg, Package
# FIXME: ugly hackery. http://code.djangoproject.com/ticket/3450
import django.db