Age | Commit message (Collapse) | Author |
|
A few Jinja2 fixes and some perf changes
|
|
Jinja2 switch for some templates, exact matches in package search
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
There have been a few proposed solutions to this, but there really isn't
anything without a drawback. Things break pagination, require loading
the entire result set from the database, etc.
Just plop a new table on the page if someone did a so-called "simple"
search and we have a match. Only show on the first page of the search
results. This results in a relatively fast experience for someone doing
something like searching for the "perl" package.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We wrap the whole thing in a Django template so we don't have to convert
our base template to Jinja2 (or have one for each templating engine).
This also simplifies the static stuff so we can just keep using the
Django tags.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is a start at improving performance of rendering the package
details page, our most-visited and slowest page on the production
website. The Django template system is not very efficient due to our
heavy use of broken out templates and pulling of various attributes and
such on related packages.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
templates/public/download.html
templates/public/index.html
|
|
Ensure we always coerce values to unicode in our __unicode__ method, and
remove some now unneeded verbosity and comments since the upstream bug
has been fixed.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The removal of the root `__init__.py` file is so the testing framework
does consistent imports of our models now that the loading strategy has
changed.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Django 1.7 has built-in migrations support, so we no longer want these
around. All existing installs should be fully migrated at this point to
the latest schema.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Fix long filenames; local storage for filter prefs
Conflicts:
templates/public/download.html
|
|
This helps when doing the irregular cleanup of these things and making
sure a relation has been stale for some time and not just a couple
minutes or hours.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
End of month release, perf fixes
|
|
Django 1.6 upgrade and other changes
Conflicts:
templates/news/list.html
templates/public/index.html
|
|
I was never using this and it adds some pretty substantial overhead to
each render of the admin page, so toss it. Add the simple date filter to
the sidebar instead.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This allows the tag to be used in a few more places we weren't already
able to use it, and hopefully speeds up rendering a tad on the package
differences page.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
PendingDeprecationWarning: `queryset` method should be renamed `get_queryset`
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
Otherwise we do one query per row in the signoff table to fetch the
architecture and it's required_signoffs value, which is less than ideal.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
And respect it elsewhere when we create a fake default specification
because a real one does not exist yet.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
Conflicts:
devel/views.py
feeds.py
public/views.py
settings.py
sitestatic/archweb.js
templates/base.html
templates/devel/profile.html
templates/mirrors/status.html
templates/news/view.html
templates/packages/flaghelp.html
templates/packages/opensearch.xml
templates/public/download.html
templates/public/feeds.html
templates/public/index.html
templates/registration/login.html
templates/releng/results.html
templates/todolists/public_list.html
|
|
This is dirty, but it works. There is probably a better and cleaner way
to do all of this, but for now just fix it quickly.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Most of these were suggested by PyCharm, and include everything from
little syntax issues and other bad smells to dead or bad code.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
This was added in Django 1.4, and ensures both GET and HEAD requests,
but not POST requests, are allowed through.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Whoops. Just introduced this when ensuring we look for both the packgae
in other repositories as well as any replacments.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This covers the case where we can't find the package in any other
repositories, but it was removed recently enough that we have a found
package update object.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This allows our normal keyword-based search to be index-optimized rather
than always doing full table scans. It requires the pg_trgm extension
which is shipped out of the box with any sane install of PostgreSQL.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This does not include templates
|
|
|
|
We don't see these called enough to make caching the data worth it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The get_profile() function is deprecated as of Django 1.5.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This gets some proper unittest skip decorator action now in addition to
adding more testing around everything.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
requirements.txt
requirements_prod.txt
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
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>
|
|
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>
|
|
This was added in Django 1.5 and allows saving only a subset of a
model's fields. It makes sense in a few cases to utilize it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This reverts commit 20b64e42672d185821cc584dfa4b133ee259a144.
Django 1.5 fixed this issue and now parent objects are automatically
attached to their children when queries go through the related manager.
See "Caching of related model instances" in the release notes.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|