Commit Graph

68 Commits

Author SHA1 Message Date
Dan McGee
a5f5557493 Use python json module directly in place of simplejson
As of Python 2.6, this is a builtin module that has all the same
functions and capabilities of the Django simplejson module. Additionally
simplejson is deprecated in the upcoming Django 1.5 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12 09:32:30 -05:00
Dan McGee
badc535aeb Ensure order_by default value is cleared when using distinct()
Otherwise the queryset returns nonsensical results. I find the design of
this less than obvious but so be it; we can ensure the results work
regardless of a default ordering on the model.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02 09:37:46 -05:00
Dan McGee
dc94eade03 Incomplete-only todolists optimization
We can push this down to the database if we know in advance we only need
the incomplete lists. This helps our call on the developer dashboard
quite a bit; the time of the single query in question drops from >1300ms
to around 40ms.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27 09:12:26 -05:00
Dan McGee
9684e7c095 Prevent selection of many useless fields when getting todolists
This is a bit of a hack, but makes the resulting resultset returned from
the database a lot smaller and kills off all the columns we don't care
about and would never look at.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 14:55:07 -05:00
Dan McGee
b8c20439c0 Change Django urls.py import
Until Django 1.3, the functions include(), patterns() and url() plus
handler404, handler500 were located in a django.conf.urls.defaults
module.

In Django 1.4, they live in django.conf.urls.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-23 19:54:40 -05:00
Dan McGee
6b16b9487a Adjust page and content caching lengths and decorators
Remove never_cache from many places now that we don't actually need it
since we aren't caching by default. Adjust our cache_function decorator
times be shorter values, and also randomize them a bit to make cache
invalidations not all line up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05 13:03:00 -06:00
Dan McGee
7b7dcfaa7c Add new todolist pkgbase list view
This is for use after rebuilds when moving packages out of the staging
and testing repositories.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-04 12:15:29 -06:00
Dan McGee
0db2830b8f 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 <dan@archlinux.org>
2011-11-03 23:30:16 -05:00
Dan McGee
8f3c60c8de Don't include staging packages in todolists
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 20:27:21 -05:00
Dan McGee
bf4d344c18 Fix missed list -> todolist variable rename
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04 12:54:14 -05:00
Dan McGee
064813560c Show more info about todolists on developer dashboard
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-09 16:34:10 -05:00
Dan McGee
842f59d018 Rename local variables for clarity
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-09 16:34:10 -05:00
Dan McGee
d456ff32aa Convert todolist delete to class-based view
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07 17:03:33 -05:00
Dan McGee
65e965c8f7 Send only one email per todolist
Customize each email on a per-maintainer basis and list all the relevant
packages inside, rather than spamming people.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-04 12:39:56 -06:00
Dan McGee
3f4570c199 Use transactions in todolist creation
So we do all of the work at once and don't let things leak out before
the list is completely added or updated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-04 11:11:06 -06:00
Dan McGee
0c368ce466 Correct some permission decorators
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-03 14:40:32 -06:00
Dan McGee
6e3dc1be01 Move more URLs out of root urlconf
Things are a bit cleaner now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-13 14:56:43 -06:00
Dan McGee
0e58a2e49f Todo list minor fixes and comments for later
When we show the edit todo list page, use a sorted list retrieved straight
from the database instead of a unordered set() we create at the application
level. Also add some comments for potential later improvements on
transaction boundaries and async emailing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-04 16:35:31 -05:00
Dan McGee
eaa76ae758 Improve todo list view page
Add total package count and incomplete package count columns. Also reduce
the number of total queries by killing the query per row that was happening
before.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 13:36:41 -05:00
Dan McGee
872af225a9 Use direct_to_template in all remaining possible places
Rather than the need to include RequestContext() calls directly, we can
just use direct_to_template to do all the work for us.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 13:45:13 -05:00
Dusty Phillips
d316f4b197 Add a basic view for todo lists
Dan: rename template and view to something a bit more concise.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-25 15:57:10 -05:00
Dan McGee
cb9c74eff8 Add absolute URL method for todo lists
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05 22:20:28 -05:00
Evangelos Foutras
86d503af5a Mark the todolists' flag view as never_cache
Also remove the @vary_on_headers('X-Requested-With') since it's
irrelevant now.

Dan: remove now unnecessary import.

Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-28 06:51:43 -05:00
Dan McGee
0fb770442e Mark a few more pages as never cache
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-24 17:09:41 -05:00
Dan McGee
081ed6c866 Add 'never_cache' decorator in a bunch of places
Now that we cache everything, we need to ensure anyone doing edits and
such gets the live data and not some cached version that was already
updated and is now stale. Add the never_cache decorator to any of the
CUD screens as well as a few others that might benefit from always being
regenerated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-22 12:09:22 -05:00
Dan McGee
8bf0bfeac7 Use Sites framework instead of hardcoded domain name
Instead of putting 'www.archlinux.org' all over the place, use the Django
sites framework to pull the site name out of the database. Now these
amazing things will work if you are running locally and decide to change the
site!

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08 08:35:58 -05:00
Dan McGee
32f6f7a4da Rename todolist email template
More in line with our other templates that have .txt extensions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 10:44:02 -05:00
Dan McGee
d797eac372 Fix undefined variable issue
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-21 15:48:32 -05:00
Dan McGee
a52e3901c9 Fix package URL in todo list emails
Fixes FS#18935.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-02 17:32:45 -05:00
Dan McGee
e790c2b744 Fix todolist dealing with package maintainers
Forgot to update this, whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-29 20:17:11 -05:00
Dan McGee
d4155f7d0f Use repo.testing flag instead of test-based checks
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06 15:37:02 -06:00
Dan McGee
6e9477ca63 Unify spelling of 'Todo'
We used 'Todo', 'ToDo', and 'To-do' in different places. Unify them all to
the first.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-01 21:43:12 -06:00
Dan McGee
1c073bea62 Ensure our cache is correct with AJAX requests
Since the same URLs serve two different responses based on the request being
AJAX or not, we want to ensure we don't cache the wrong one and serve it up
incorrectly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-27 13:36:58 -06:00
Evangelos Foutras
ce0b9076ee Implement AJAX flagging for todo items
[Some trailing whitespace got killed in the process. :3]

Dan: I made a few small changes including moving the jQuery include down
above the other script block; since it is not needed right away it can be
loaded later in the page.

Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-26 21:03:09 -06:00
Dan McGee
d709604102 Remove archweb prefix from all imports
Unnecessary, and lets us standardize on not using it everywhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-10 00:29:27 -06:00
Dan McGee
f58b354a03 Use select_related() to make a few more places more performant
Especially when looking at packages, we always want the arch and repo.
Another big hunk of changes deals with the very inefficient signoffs code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-31 15:19:12 -06:00
Evangelos Foutras
09a3a08144 Adjust models and views for nullable maintainer
Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
[Dan: made a few other small touchups]
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-31 13:44:03 -06:00
Evangelos Foutras
61e8a6b4c3 Exclude repos ending with "Testing" from ToDos
This should fix the issue with Community-Testing packages appearing in
ToDo lists.

After this change has been applied, simply edit and save a ToDo list to
make its Community-Testing packages go away.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-30 15:55:19 -06:00
Ismael Carnales
6a11b84463 added login_required to protect todolists views 2009-11-10 18:32:47 -02:00
Ismael Carnales
ce662e0e0c fixed error in todolists list view 2009-11-09 22:24:36 -02:00
Ismael Carnales
48904e4857 modified import paths from archweb_dev to archweb 2009-11-09 22:24:34 -02:00
Dusty Phillips
ad9672eeb4 drop some print statements 2008-10-11 20:09:15 -04:00
Dusty Phillips
f260843deb use RequestContext because its standard 2008-10-10 18:51:21 -04:00
Dusty Phillips
82edf2d07b port to django 1.0 2008-10-10 18:00:35 -04:00
Dusty Phillips
103d1a347a drop a bunch of unusued imports 2008-10-05 21:46:28 -04:00
Dusty Phillips
7d8feb3370 drop some unused imports 2008-10-05 21:41:08 -04:00
Dusty Phillips
64c6711ff3 fix problem with to-do list showing testing packages 2008-07-22 20:47:26 -04:00
Dusty Phillips
e354b32898 fix up permissions on todolists 2008-07-08 21:20:06 -04:00
Dusty Phillips
eb6feb5e6d stupid stupid variable overwrite 2008-07-01 19:12:47 -04:00
Dusty Phillips
d91e5e0268 mistake 2008-07-01 19:02:14 -04:00