summaryrefslogtreecommitdiffstats
path: root/packages
AgeCommit message (Collapse)AuthorFilesLines
2013-02-16Make page a query string parameter on package searchDan McGee2-1/+2
This is a bit silly to encode in the URL, or at least makes it much harder to screen out via robots.txt and other such things. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-16Remove configurable pagination for package searchDan McGee1-37/+1
Switch it to a hardcoded value of 100 for all searches instead. It didn't make much sense having a page number be part of the URL and a limit value being part of the query string. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-10Fix split packages sitemapDan McGee1-1/+1
We had a ton of duplicate entries included due to the query implicitly including a 'GROUP BY' clause on the default sorting by pkgname. Fix it and cut the sitemap down to the correct size without duplicate entries. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-09Remove package seach by 'Last Updated After'Dan McGee1-9/+0
It is a lot easier to just sort the list rather than mess with this particular field, which didn't even allow you to specify a range or direction to search in. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Use more modern verison of string template formattingDan McGee1-6/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Use querysets for calls to get_object_or_404(Package)Dan McGee2-7/+7
This works better in most cases since we need the architecture and repository objects at some point during the view process. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Slight optimization when searching for removed packageDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Override the default admin queryset for some modelsDan McGee1-0/+10
Because some attributes are optional or otherwise not auto-magically picked up by Django, we can help the performance of loading these pages a lot by forcing a select_related() on the queryset used by the admin. For something like signoff_specifications, this drops the query count from ~107 to 9 queries. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-22Use a subquery rather than two queries in attach_maintainersDan McGee1-2/+6
Now that we are using a database that doesn't stink, it makes more sense to do all of the stuff we need to do down at the database level. This helps a lot when 500+ packages are in play at a given time, such as some of our larger rebuild todo lists. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19Use a set instead of list when gathering package differencesDan McGee1-10/+15
If we implement the __eq__ and __hash__ methods, we can use a set to gather package difference objects and make deduplication of objects a lot more efficient. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Use content_type and not mimetype on HttpResponse()Dan McGee4-7/+7
Bug #16519 in Django deprecates mimetype, so update our code accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Make packages JSON search more performantDan McGee1-2/+6
We were peppering the database with a bunch of queries here; using prefetch_related and attach_maintainers can cut down the count significantly. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Add get_associated_packages method to FlagRequestDan McGee1-0/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Reduce query count when retrieving satisfiers and providersDan McGee1-8/+12
Django doesn't attach the parent object to the child objects, even when queried through the related manager. This causes up to 3 extra queries: one to retrieve the package again, and one each for arch and repo retrieval. For a package like archboot, this drops the number of necessary queries for the package page from 805 to 222 (yes, this is still too high) and cuts the time spent waiting on the database from 505ms to 262ms. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Allow pkg_details_link to return link title if package is missingDan McGee1-1/+1
For todolist packages that have had their package removed, this will allow the package name to continue to appear even after the linked package has been deleted. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Make attach_maintainers null-safeDan McGee1-1/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Add some more tests for ALPM API stuffDan McGee1-0/+27
These are super-simple, but it is also trivial to test. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-12Fix FS#32018, provides links always go to [testing] packagesDan McGee1-18/+6
Remove some of the smarts and do less, but be better about properly sorting the items as one might expect. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16Use python set comprehension syntax supported in 2.7Dan McGee3-7/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16Use Python 2.7 dictionary comprehension syntaxDan McGee3-9/+6
Rather than the old idiom of dict((k, v) for <> in <>). Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-27Cleanup meta model attributesDan McGee1-2/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-27Extract some common architecture grabbing logicDan McGee1-6/+9
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-14Refactor signoff-grabbing queriesDan McGee1-22/+18
Make them a bit more efficient by adding an explicit condition on both the packages and signoff table for the repo ID, and move the common code into a shared function both can use. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-12Make wrong permissions query more efficientDan McGee1-5/+6
This removes the subplan and per-row query in favor of a LEFT JOIN where we look for non-matching rows. Tested in sqlite3 and PostgreSQL. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-30pkg_details_link template tag enhancementsDan McGee1-2/+6
* Output the blank string when passed None for pkg argument * Allow override of the link text if optional argument passed Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-30Fix usage of naïve datetime objectDan McGee1-2/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-30Hide staging packages in search resultsDan McGee1-3/+12
This is for users that aren't logged in; developers will still see them. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-26Don't show staging in package search repo listingDan McGee1-1/+2
This is temporary or at least a quick way to ensure regular users aren't confused by staging packages; later updates should re-enable display of this for logged in developers and trusted users. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-15Remove now unnecessary importDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-08p/v/flag: Add reply-to to out-of-date notificationsFlorian Pritz1-3/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-21Fix scm_link in a way that doesn't make cgit barfDan McGee1-1/+1
This does what commit cd51842ce86 set out to do in a way that doesn't break cgit's not-so-hit query string parsing. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-21Style cleanups in package_extrasDan McGee1-1/+12
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-21Revert "Fix scm_link for Unicode characters"Dan McGee1-6/+5
This reverts commit cd51842ce86c44eef4e3c3d5334aca13e234151a. It turns out cgit doesn't like it if you escape the '/' in the URL parameter when viewing the log (a clear upstream bug), but we need to be able to work around this. Example: 'extra%2Fkdelibs' and 'extra/kdelibs' are handled differently.
2012-08-21Fix scm_link for Unicode charactersDan McGee1-5/+6
This blew up with non-ASCII due to us trying to stuff 8-bit characters into the URL parameters where they aren't allowed. Tested with a package entered via the admin with pkgname and pkgbase set to 'αναζήτη'. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-21Use case-insensitive search in opensearch suggestionsDan McGee1-2/+8
There is no real good reason not to do this, since our packages are lowercased by convention. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-15Ensure created is set when creating flag request via adminDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-15Fix signoffs SQL queryDan McGee1-1/+2
Although the old query returned the same results, the repos IN clause should really be a part of the WHERE, not the JOIN condition. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-14Attempt to screen for useless out-of-date messagesDan McGee1-1/+11
Things like ' ', '-', '.', etc. will no longer be accepted in this field. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Drop old flag request version columnDan McGee2-1/+213
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Migrate flag request version info to new formatDan McGee3-6/+226
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09PEP8 cleanups in package utilsDan McGee1-6/+11
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Extract parse_version function from reporead logicDan McGee1-0/+18
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Begin split of flag request version column into partsDan McGee2-0/+236
Not sure why on only this one I decided to put all three parts in the same column. We don't do this anywhere else. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Fix alpm ctypes interface on systems not having alpmDan McGee1-5/+12
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-08Push more default values down into the databaseDan McGee1-1/+1
This makes it easier to do manual manipulation/insertion/etc. at the database level, as well as just making things act more sane from an overall software stack perspective. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-08Make use of new ctypes ALPM APIDan McGee1-0/+23
We can use this when filtering down lists of depends, required by, conflicts, etc. to ensure we are honoring the version specifications the same way pacman would. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-07Add ctypes-based wrapper to ALPM vercmp APIDan McGee1-0/+68
This will allow us to do some additional stuff on systems that have libalpm available; namely we can use the version comparison logic it provides to do smarter filtering etc. of fields that use comparsion operations. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-04Include description in Depend unicode() outputDan McGee1-0/+7
This overrides the base class __unicode__ method. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-04Remove optional package depends columnDan McGee2-1/+211
This is now completely replaced by the deptype column. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-04Make adjustments for optional -> deptype conversionDan McGee1-0/+210
Very little dealt directly with this field. Signed-off-by: Dan McGee <dan@archlinux.org>