summaryrefslogtreecommitdiff
path: root/public/utils.py
AgeCommit message (Collapse)Author
2011-10-11Pylint suggested and other cleanupsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05Recent updates refactorDan McGee
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 McGee
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 McGee
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 McGee
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 McGee
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 McGee
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 McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-17Improve front page recent updates listrelease_2010-04-17Dan McGee
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 McGee
Fixes FS#18436. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-10Remove archweb prefix from all importsDan McGee
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 McGee
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>