From 8019319a4fe5f52779f9f2531e3aa24aacbe43f5 Mon Sep 17 00:00:00 2001 From: eliott Date: Sat, 8 Mar 2008 00:19:58 -0800 Subject: renamed donator model to donor. remove category model --- devel/views.py | 12 ++++++------ main/models.py | 10 +--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/devel/views.py b/devel/views.py index b073d29..741b869 100644 --- a/devel/views.py +++ b/devel/views.py @@ -4,7 +4,7 @@ from django.contrib.auth.models import User from django.core import validators from archweb_dev.main.utils import render_response, validate from archweb_dev.main.models import Package, Repo, Todolist, TodolistPkg -from archweb_dev.main.models import UserProfile, News, Donator, Mirror +from archweb_dev.main.models import UserProfile, News, Donor, Mirror from django.http import HttpResponse from django.template import Context, loader @@ -96,12 +96,12 @@ def developers(request): return render_response(request, 'devel/developers.html', {'devs':devs}) def donate(request): - donor_count = Donator.objects.count() + donor_count = Donor.objects.count() splitval = donor_count / 4 - slice1 = Donator.objects.all()[:splitval] - slice2 = Donator.objects.all()[(splitval):(splitval*2)] - slice3 = Donator.objects.all()[(splitval*2):(donor_count-splitval)] - slice4 = Donator.objects.all()[(donor_count-splitval):donor_count] + slice1 = Donor.objects.all()[:splitval] + slice2 = Donor.objects.all()[(splitval):(splitval*2)] + slice3 = Donor.objects.all()[(splitval*2):(donor_count-splitval)] + slice4 = Donor.objects.all()[(donor_count-splitval):donor_count] return render_response(request, 'devel/donate.html', {'slice1':slice1,'slice2':slice2,'slice3':slice3,'slice4':slice4}) diff --git a/main/models.py b/main/models.py index a246e33..db63d59 100644 --- a/main/models.py +++ b/main/models.py @@ -75,7 +75,7 @@ class Mirror(models.Model): search_fields = ('domain') pass -class Donator(models.Model): +class Donor(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(maxlength=255) def __str__(self): @@ -102,13 +102,6 @@ class News(models.Model): def get_absolute_url(self): return '/news/%i/' % self.id -class Category(models.Model): - id = models.AutoField(primary_key=True) - category = models.CharField(maxlength=255) - class Meta: - db_table = 'categories' - verbose_name_plural = 'categories' - class Repo(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(maxlength=255) @@ -127,7 +120,6 @@ class Package(models.Model): id = models.AutoField(primary_key=True) repo = models.ForeignKey(Repo) maintainer = models.ForeignKey(User, related_name='package_maintainer') - category = models.ForeignKey(Category) needupdate = models.BooleanField(default=False) pkgname = models.CharField(maxlength=255) pkgver = models.CharField(maxlength=255) -- cgit v1.2.3-24-g4f1b