diff options
author | Dan McGee <dan@archlinux.org> | 2010-07-07 01:36:50 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-07-07 01:36:50 +0200 |
commit | fba1d29c1b8fcc58a5501aad206901e6217cd530 (patch) | |
tree | 9e4307e16ee0e9795a84b2f8bac657c3c5e0d1ec | |
parent | 145b80d0c6c466b08caf094df14d74ae56235151 (diff) | |
download | archweb-fba1d29c1b8fcc58a5501aad206901e6217cd530.tar.gz archweb-fba1d29c1b8fcc58a5501aad206901e6217cd530.tar.xz |
Update code to use new flag_date column
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | devel/management/commands/reporead.py | 2 | ||||
-rw-r--r-- | devel/views.py | 2 | ||||
-rw-r--r-- | main/models.py | 2 | ||||
-rw-r--r-- | packages/views.py | 14 | ||||
-rw-r--r-- | templates/packages/details.html | 2 | ||||
-rw-r--r-- | templates/packages/search.html | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 62dce66..854b632 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -151,7 +151,7 @@ def populate_pkg(dbpkg, repopkg, force=False, timestamp=None): pass if timestamp: - dbpkg.needupdate = False + dbpkg.flag_date = None dbpkg.last_update = timestamp dbpkg.save() diff --git a/devel/views.py b/devel/views.py index c600f08..5f4bcb9 100644 --- a/devel/views.py +++ b/devel/views.py @@ -25,7 +25,7 @@ pwletters = ascii_letters + digits def index(request): '''the Developer dashboard''' inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase') - flagged = Package.objects.select_related('arch', 'repo').filter(needupdate=True) + flagged = Package.objects.select_related('arch', 'repo').filter(flag_date__isnull=False) flagged = flagged.filter(pkgbase__in=inner_q) todopkgs = TodolistPkg.objects.select_related( diff --git a/main/models.py b/main/models.py index 758e403..cd09dea 100644 --- a/main/models.py +++ b/main/models.py @@ -49,7 +49,7 @@ class TodolistManager(models.Manager): class PackageManager(models.Manager): def flagged(self): - return self.get_query_set().filter(needupdate=True) + return self.get_query_set().filter(flag_date__isnull=False) ############################# ### General Model Classes ### diff --git a/packages/views.py b/packages/views.py index cf37361..dfa150c 100644 --- a/packages/views.py +++ b/packages/views.py @@ -13,7 +13,7 @@ from django.views.decorators.vary import vary_on_headers from django.views.generic import list_detail from django.db.models import Q -import datetime +from datetime import datetime import string from main.models import Package, PackageFile @@ -160,9 +160,9 @@ def search(request, page=None): packages = packages.filter(pkgbase__in=inner_q) if form.cleaned_data['flagged'] == 'Flagged': - packages=packages.filter(needupdate=True) + packages=packages.filter(flag_date__isnull=False) elif form.cleaned_data['flagged'] == 'Not Flagged': - packages = packages.filter(needupdate=False) + packages = packages.filter(flag_date__isnull=True) if form.cleaned_data['q']: query = form.cleaned_data['q'] @@ -171,7 +171,7 @@ def search(request, page=None): if form.cleaned_data['last_update']: lu = form.cleaned_data['last_update'] packages = packages.filter(last_update__gte= - datetime.datetime(lu.year, lu.month, lu.day, 0, 0)) + datetime(lu.year, lu.month, lu.day, 0, 0)) limit = form.cleaned_data['limit'] else: form = PackageSearchForm() @@ -214,7 +214,7 @@ def files(request, name='', repo='', arch=''): def unflag(request, name='', repo='', arch=''): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) - pkg.needupdate = 0 + pkg.flag_date = None pkg.save() return HttpResponseRedirect(pkg.get_absolute_url()) @@ -280,7 +280,7 @@ def flag(request, name='', repo='', arch=''): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) context = {'pkg': pkg} - if pkg.needupdate == 1: + if pkg.flag_date is not None: # already flagged. do nothing. return render_to_response('packages/flagged.html', context) @@ -290,7 +290,7 @@ def flag(request, name='', repo='', arch=''): # find all packages from (hopefully) the same PKGBUILD pkgs = Package.objects.filter( pkgbase=pkg.pkgbase, repo__testing=pkg.repo.testing) - pkgs.update(needupdate=True) + pkgs.update(flag_date=datetime.now()) maints = pkg.maintainers if not maints: diff --git a/templates/packages/details.html b/templates/packages/details.html index e52a005..3001709 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -14,7 +14,7 @@ <li><a href="{{ pkg.get_trunk_svn_link }}" title="View SVN entries on trunk">SVN Entries (trunk)</a></li> <li><a href="{{ pkg.get_bugs_link }}" title="View existing bug tickets for {{ pkg.pkgname }}">Bug Reports</a></li> <li> - {% if pkg.needupdate %} + {% if pkg.flag_date %} <span class="flagged">This package has been flagged out-of-date</span> {% if user.is_authenticated %} <br /> <a href="unflag/" diff --git a/templates/packages/search.html b/templates/packages/search.html index fbbd11e..c0eff98 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -96,7 +96,7 @@ <td>{{ pkg.repo.name|capfirst }}</td> <td><a href="{{ pkg.get_absolute_url }}" title="View package details for {{ pkg.pkgname }}">{{ pkg.pkgname }}</a></td> - {% if pkg.needupdate %} + {% if pkg.flag_date %} <td><span class="flagged">{{ pkg.pkgver }}-{{ pkg.pkgrel }}</span></td> {% else %} <td>{{ pkg.pkgver }}-{{ pkg.pkgrel }}</td> |