From 0db2830b8fda4d898a184a31f3375c10f3cc4083 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 3 Nov 2011 23:30:16 -0500 Subject: Make maintainer lookup on todo lists fast This is rather sick to look at. Sorry, Django gives me no other choice. Signed-off-by: Dan McGee --- todolists/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'todolists') diff --git a/todolists/views.py b/todolists/views.py index 8ad7be56..585cefd0 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -12,6 +12,7 @@ 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 @@ -163,8 +167,10 @@ def send_todolist_emails(todo_list, new_packages): 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: -- cgit v1.2.3-54-g00ecf From 623e0453cee5e3f663a0b18d68db0396cc812983 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 1 Dec 2011 23:35:41 -0500 Subject: I think this fixes all the broken links (that point to parabolagnulinux.org anyway) --- devel/views.py | 2 +- settings.py | 2 +- templates/base.html | 2 +- templates/packages/flaghelp.html | 2 +- templates/public/art.html | 2 +- templates/public/download.html | 2 +- templates/public/feeds.html | 2 +- templates/public/index.html | 4 ++-- todolists/views.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) (limited to 'todolists') diff --git a/devel/views.py b/devel/views.py index 7cc45419..b9bd7cce 100644 --- a/devel/views.py +++ b/devel/views.py @@ -292,7 +292,7 @@ def save(self, commit=True): send_mail("Your new parabolaweb account", template.render(ctx), - 'Parabola ', + 'Parabola ', [user.email], fail_silently=False) diff --git a/settings.py b/settings.py index cb17c96c..e1fc45d5 100644 --- a/settings.py +++ b/settings.py @@ -13,7 +13,7 @@ MANAGERS = ADMINS # Package out-of-date emails for orphans -NOTIFICATIONS = ['packages@list.parabolagnulinux.org'] +NOTIFICATIONS = ['dev@lists.parabolagnulinux.org'] # Full path to the data directory DEPLOY_PATH = os.path.dirname(os.path.realpath(__file__)) diff --git a/templates/base.html b/templates/base.html index ca492281..b537c603 100644 --- a/templates/base.html +++ b/templates/base.html @@ -39,7 +39,7 @@
  • Architecture Differences
  • Archives
  • Dev Clocks
  • {% if user.is_staff %} diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html index e33ba0f5..d60018fa 100644 --- a/templates/packages/flaghelp.html +++ b/templates/packages/flaghelp.html @@ -25,7 +25,7 @@

    Flagging Packages

    The message box portion of the flag utility is optional, and meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send - an email to the parabola mailing list with your additional text.

    diff --git a/templates/public/art.html b/templates/public/art.html index 68179f23..3a92b8b4 100644 --- a/templates/public/art.html +++ b/templates/public/art.html @@ -10,7 +10,7 @@

    Parabola Logos and Artwork

    You can help by creating artwork for Parabola GNU/Linux-libre.

    -

    Send your designs to web@list.parabolagnulinux.org and state they are CC-by-sa +

    Send your designs to dev@lists.parabolagnulinux.org and state they are CC-by-sa or another free culture friendly license.

    diff --git a/templates/public/download.html b/templates/public/download.html index 7a1cd855..207414dc 100644 --- a/templates/public/download.html +++ b/templates/public/download.html @@ -23,7 +23,7 @@

    Release Info

  • Resources:
  • diff --git a/templates/public/feeds.html b/templates/public/feeds.html index 79e8a1aa..da70e6ee 100644 --- a/templates/public/feeds.html +++ b/templates/public/feeds.html @@ -17,7 +17,7 @@

    News and Activity Feeds

    the Parabola staff.

    The Parabola Wiki: Recent changes feed is also available to track document changes from the Mailing Lists -

  • Dev Archives
  • IRC Channels
  • diff --git a/todolists/views.py b/todolists/views.py index 43763545..233102cf 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -161,7 +161,7 @@ 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 ', + 'Parabola ', [maint], fail_silently=True) -- cgit v1.2.3-54-g00ecf