summaryrefslogtreecommitdiffstats
path: root/public/utils.py
AgeCommit message (Collapse)AuthorFilesLines
2011-10-11Pylint suggested and other cleanupsDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05Recent updates refactorDan McGee1-25/+13
Pull out a few helpful objects and functions for use later elsewhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Refactor common select_related into manager methodDan McGee1-3/+3
For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-05Collapse all split and similar packages in recent updates listrelease_2011-04-05Dan McGee1-14/+61
I was getting sick of seeing the *-i18n packages completely blow away anything else useful out of the recent updates sidebar. Revamp the logic here again to do something about it. As we did before, grab packages from the database and attempt to group them, but this time do it by only repo and pkgbase. From there, if we have packages in the group with a pkgname matching pkgbase, we will link just those. If not, we will create some stub objects that link to our relatively new virtual package overview screen. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-13Move magic numbers into a function argumentDan McGee1-4/+5
Instead of having the '15 most recent' bit hardcoded, specify it as the default but allow value to be overridden by any caller. We don't make use of this yet, but it is not hard to do. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-11-27Simplify sorting attrgetter callsDan McGee1-2/+2
Don't use dotted notation now that we have less-than implemented methods on the respective objects (which also allows this code to work under PyPy). Switch a lambda call to use attrgetter as well. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28PyLint suggested cleanupsDan McGee1-5/+9
We had a bunch of extra imports, non-conventional variable names, spacing issues, etc. that were relatively low-hanging fruit to clean up. Fix them and make the code a bit cleaner in the process. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21Cache the recent updates listDan McGee1-0/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-17Improve front page recent updates listrelease_2010-04-17Dan McGee1-4/+11
Instead of linking the package name, link the architecture. This will prevent the lost links we had when we collapsed the list to show multiple architectures at the same time. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-26Only group packages if they are in the same repoDan McGee1-1/+1
Fixes FS#18436. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-10Remove archweb prefix from all importsDan McGee1-1/+1
Unnecessary, and lets us standardize on not using it everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-05Make recent updates group multiple architecturesDan McGee1-0/+19
It isn't the most elegant operation in the world, but attempt to only show one line per package, grouping by architecture if multiple were updated in the same go. This makes the recent packages view a bit more useful as a heads up view. Implements FS#17304. Signed-off-by: Dan McGee <dan@archlinux.org>