diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-12-04 23:07:59 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-12-04 23:07:59 -0300 |
commit | 988c2c6d400b3721464c2891891807d504b076b0 (patch) | |
tree | 013dc3d676edad701d0d3bbd239bc2df0cdf76b4 /todolists | |
parent | 60a1fc6cc4cef0b9eed58ea4f0ca003b76ec382a (diff) | |
parent | 183c4d9cefa95f46c3fa3a6936f837542426eac2 (diff) |
Merge branch 'master' of ssh://gparabola/parabolaweb
Conflicts:
local_settings.py.example
media/archweb.css
packages/templatetags/package_extras.py
public/views.py
templates/packages/details.html
templates/packages/flag.html
templates/packages/flag_confirmed.html
templates/packages/flagged.html
templates/packages/search.html
templates/public/download.html
templates/todolists/view.html
Diffstat (limited to 'todolists')
-rw-r--r-- | todolists/views.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/todolists/views.py b/todolists/views.py index a63516e8..233102cf 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -12,6 +12,7 @@ from django.template import Context, loader from django.utils import simplejson from main.models import Todolist, TodolistPkg, Package +from packages.utils import attach_maintainers from .utils import get_annotated_todolists class TodoListForm(forms.ModelForm): @@ -49,6 +50,9 @@ def flag(request, listid, pkgid): @never_cache def view(request, listid): todolist = get_object_or_404(Todolist, id=listid) + # we don't hold onto the result, but the objects are the same here, + # so accessing maintainers in the template is now cheap + attach_maintainers(tp.pkg for tp in todolist.packages) return direct_to_template(request, 'todolists/view.html', {'list': todolist}) @login_required @@ -157,14 +161,16 @@ def send_todolist_emails(todo_list, new_packages): template = loader.get_template('todolists/email_notification.txt') send_mail('Packages added to todo list \'%s\'' % todo_list.name, template.render(ctx), - 'Parabola <packages@list.parabolagnulinux.org>', + 'Parabola <dev@lists.parabolagnulinux.org>', [maint], fail_silently=True) def public_list(request): todo_lists = Todolist.objects.incomplete() + # total hackjob, but it makes this a lot less query-intensive. + all_pkgs = [tp for tl in todo_lists for tp in tl.packages] + attach_maintainers([tp.pkg for tp in all_pkgs]) return direct_to_template(request, "todolists/public_list.html", {"todo_lists": todo_lists}) - # vim: set ts=4 sw=4 et: |