summaryrefslogtreecommitdiffstats
path: root/packages/views/search.py
AgeCommit message (Collapse)AuthorFilesLines
2014-09-05FS#30773 - package search: put exact match at the topworkingFlorian Pritz1-0/+12
This might not be the cleanest or best performing solution, but it works. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-04-17Add shortcut for HEAD requests on slower viewsDan McGee1-1/+3
We sometimes see some web bots and crawlers make HEAD requests to verify existence of certain pages in the application. However, they are less than kind as 20-50 requests might arrive at the same time, and package search and details pages are some of the slowest rendering pages we have due to the Django template engine. Rather than waste time generating the content only to throw it away, response as soon as we can with either a 404 or 200 response as appropriate, omitting the 'Content-Length' header completely, which seems to be acceptable by the HTTP spec. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-20Fix some fallout with moving page to query paramsDan McGee1-1/+3
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-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-14Use content_type and not mimetype on HttpResponse()Dan McGee1-1/+1
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>
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-07-31Fix broken hidden input sort field on search formDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-25Replace deprecated list_detail usage in search with class-based viewDan McGee1-38/+39
We can convert the entire search view to a generic class-based ListView. This is still one of the more disgusting views in the application and has a ton of logic scattered buckshot across several methods, but this commit is not meant to address all of that in one go. This is the last of the deprecated pieces I know of we are still using in the codebase, so we should be relatively safe in the long run now for an upgrade to the eventual next major Django release. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12Use python json module directly in place of simplejsonDan McGee1-3/+2
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-04-07Add JSON search viewDan McGee1-0/+26
This still might change and should not be viewed as a public API yet. This has been a longstanding request in FS#13026. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-02Make hidden 'name' search field match exactlyDan McGee1-1/+1
This is much more useful than the old contains match if you are trying to narrow down your search to a specific package. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-24Revert "Add some dev dashboard info regarding signed package count"Dan McGee1-8/+0
This reverts commit 797185faed0555efb88a1e6a18e447548a9935fd. Now that all packages in the Arch repos are signed, this column isn't very useful as it just reflects the total package count. Conflicts: packages/views.py -> packages/views/search.py Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21Better support for non-latin full namesDan McGee1-1/+2
Add a 'latin_name' field to the user profile so we can better support those developers with names in non-Latin scripts, and yet still show a Latin name as necessary on the developer profile page. This field only shows up if populated. Also, use consistent sorting everywhere- rather than using username, always use first_name and last_name fields. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-11packages/view/search: refactor out the form parsing codeDan McGee1-51/+57
This is a block of very repetitive code that lends itself well to being a separate method. It would still be nice to find a way to clean this up but that can come later. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-11packages/views: split out search viewDan McGee1-0/+161
Signed-off-by: Dan McGee <dan@archlinux.org>