summaryrefslogtreecommitdiffstats
path: root/packages
AgeCommit message (Collapse)AuthorFilesLines
2012-07-09Use a set instead of list when gathering package IDs to fetchDan McGee1-1/+1
If we have duplicates in this list, it makes no sense to include them in the list we send to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-02Add indexes on 'created' field to several package-related modelsDan McGee2-3/+217
These models regularly sort by or limit by the created field, so adding a index on the created database column makes sense. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-02Log package updates during reporead invocationDan McGee1-0/+36
This adds a Manager and log_update method to help log all updates made to the packages table during reporead runs. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-02Add new package Update modelDan McGee3-2/+302
This will be used to track updates to package as we do them during reporead. By storing enough relevant fields from the package object, we should be able to produce a useful report on a regular basis of what has been happening in the repositories. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-02Remove no-longer necessary delayed imports of PackageDan McGee1-10/+7
Since commit 158be107e4ad6, we have been importing the Package model at the top-level in this file, so we can kill this code that was never updated. This should also give us back any performance hit we were seeing from the delayed imports. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Drop old PackageDepend modelDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Switch to usage of new Depend objectDan McGee2-7/+33
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Migrate package depends data into new modelDan McGee1-0/+246
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Add new depends modelDan McGee2-0/+206
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Issue redirects from non-agnostic to agnostic URLs if unambiguousDan McGee1-0/+10
For something like "/extra/i686/apache-ant/", we can redirect to "/extra/any/apache-ant/" without ambiguity. Previously this redirected to the split packages listing with a single package, which was neither correct nor really expected. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Add a get_best_satisfier method to RelatedToBaseDan McGee1-1/+35
This is basically what we do in PackageDepend already. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Refactor an abstract base class out of conflicts/provides/replacesDan McGee1-24/+17
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12Use python json module directly in place of simplejsonDan McGee3-13/+9
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-05Fix suggestion caching again for non-ASCII charactersDan McGee1-1/+2
This is why you should test this stuff with random input before rolling it out. Whoops. URL that caught this problem: /opensearch/packages/suggest?q=%D7%A0%D7%9F%D7%92%D7%9F aka /opensearch/packages/suggest?q=נןגן Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04Fix search suggestions for invalid cache keysDan McGee1-2/+3
Unfortunately, "invalid" in this case includes spaces, which is a bit crazy. MD5 the provided search term before using it as a cache key to be safe. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Flagging related cleanups and improvementsDan McGee1-10/+24
Touch up the style slightly on the flag help popup to match the main site style more closely. When a logged-in user is flagging a package out of date, we have no need for them to fill in the email field since we already have an email address on file. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Ensure order_by default value is cleared when using distinct()Dan McGee1-1/+2
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-02Add some caching to the Opensearch-related viewsDan McGee1-5/+13
Both some simple cache headers as well as low-level results caching on search terms suggestions. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Opensearch enhancementsDan McGee1-1/+17
* Add a 64x64 icon as indicated in the Opensearch specification. * Add suggestions capability and a new view providing suggestions based on package name starting with the typed value. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27Use GenericIPAddressField in flag request ip_addressDan McGee2-1/+184
New (and slightly odd with regards to verbose_name) in Django 1.4. This simply ensures a deployment in an IPv6 environment actually works as expected. If you were using PostgreSQL as a database backend, you won't be affected by this as the 'inet' type was already used, but at least now you can edit the values in the admin without getting an error. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Add JSON search viewDan McGee3-1/+28
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-07Move PackageJSONEncoder into package.utils moduleDan McGee2-37/+39
This will allow it to be used elsewhere, and doesn't really belong in views anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Choose an up-to-date mirror for download URLsDan McGee1-9/+4
Given that we collect a lot of mirror status data, we can utilize it to ensure the download link on the website actually works and newly-added packages have actually been mirrored out. Add a method that attempts to use the mirror status data to determine a mirror we should redirect our download requests to. This can change on a regular basis, and falls back to the old method if no mirror status data is available. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03Use https:// links for all internal sitesDan McGee1-1/+1
We already use HTTPS exclusively for wiki, bugs, forums, etc. and we have it available for our other sites, so link only to the https:// protocol locations when pointing users at other sites. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03Include category when linking to bug reportsDan McGee1-0/+1
Also change the default category to something legit. 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-29Return files in default orderDan McGee1-2/+4
When we read the repository databases, we get a filelist in sorted order. Save time by returning the file list in that order rather than resorting it based on filename and directory. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26Rename 'packagedepend_set' attribute to 'depends'Dan McGee1-6/+2
We do this for every other related package attribute, so do it here too. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26Add more info to package JSON dumpDan McGee1-7/+19
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-26Bump signoffs and mirror status JSON API versionsDan McGee1-1/+1
Due to datetime formatting changes in Django 1.4, we know follow the ECMA specification more closely and use 'yyyy-mm-ddThh:mm_ssZ' format. As this could break existing users of the JSON data, bump the version. 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>
2012-03-24Make all datetime objects fully timezone awareDan McGee4-8/+11
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-24Change Django urls.py importDan McGee2-2/+2
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-02-14Require message when flagging package out of dateDan McGee1-3/+3
This is not a very high bar to meet, and should cut down on at least a few bogus or spam requests. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13Protect urlencode calls against Unicode dataDan McGee3-4/+7
These would cause page errors if passed anything not in the ASCII character set. This change allows for packages to have names composed of any Unicode characters, not just those in the ASCII set. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-07FlagRequest model behavior tweaksDan McGee2-3/+8
* Add a default field to be used for latest() calls. * Remove signal-based set of created date; instead, set it explicitly so all of our packages and flag request have the exact same date and time attached. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-07Encourage bug reports to have a summaryDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-02Extract split_package_details() methodDan McGee1-17/+23
This is never currently called directly as a view method, but is used by the normal package details view as a fallback if a package cannot be located. This also fixes an issue where looking up a package in a repo it is not in returns the split details page for one package, which is incorrect behavior. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-29Support more characters in package namesDan McGee2-3/+3
Fixes FS#28106, where we couldn't view packages with names containing the '@' symbol. Rather than whitelist things, switch to a blacklist of only a space and slash character. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-26Add repo to flag request admin columnsDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-11Add old version string to saved flag requestsDan McGee4-15/+211
This makes it easier to match up a flag request with the package state at the time of flagging, and might also help to determine if flagging actions were legit. We only store it if it is the same across all packages to be marked. Also, move the various database write activities when flagging packages into a single transaction. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05Adjust page and content caching lengths and decoratorsDan McGee3-6/+2
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-03Add maintainer and packager data to package JSON viewDan McGee1-1/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12Use full version in signoff admin list viewDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12Add signoff model admin interfaceDan McGee1-3/+25
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12PyLint suggested cleanupsDan McGee4-5/+8
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-09populate_signoffs: add an SVN log cache for duplicate lookupsDan McGee1-1/+15
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08Store flag requests in the databaseDan McGee1-3/+17
This makes them persistent rather than the transient beings they currently are. We attempt to capture all the metadata we need to be able to do things with this later- aka IP address (for spam checking later), fields that allow us to mark the request as spam or not an actual out-of-date report, etc. As a bonus, logged-in developers now get the email address field filled in for free. Yay. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08Add a new FlagRequest modelDan McGee3-6/+240
This will be used to store all of the submitted data we get via flag out of date forms on the website. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08Remove auto-deletion of package relations on inactive usersDan McGee1-10/+1
We have a page where these can all be managed now, so best leave it alone in case someone accidentally marks a user inactive and all the data is lost. Signed-off-by: Dan McGee <dan@archlinux.org>