Commit Graph

154 Commits

Author SHA1 Message Date
Dan McGee
f637a1eb67 Move news model to an appropriate place
Never would have guessed it should actually be in news/models.py.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:23:55 -05:00
Dan McGee
7dba848eaf Move mirror models out of main app
South actually makes this relatively painless if you get everything right,
so might as well start getting these out of the legacy main application to
eventually eliminate models being separate from their views.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 12:01:46 -05:00
Dan McGee
fa882b7c28 Remove unnecessary comments
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 11:42:35 -05:00
Dan McGee
8bd2838504 Add ability to get versions of a package elsewhere
E.g. if we are looking at one version for a particular architecture, I want
to see all versions for all architectures in all repositories.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 00:47:50 -05:00
Dan McGee
d57696c801 PyLint suggested cleanups
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-08-28 11:41:19 -05:00
Dan McGee
60d59131de Use new repository fields in link generation code
We can rip out a lot of the code for SVN and bugs links now that this data
is pulled off the model instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-25 14:12:43 -05:00
Dan McGee
6da97045a6 Simple migration to populate repo data
Also update the repos fixture to include the new fields and [multilib]
repository.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-25 14:12:14 -05:00
Dan McGee
94fe9fc548 Add more metadata to repo model
Things like the flyspray project ID and SVN repo path should go here rather
than being hardcoded in the code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-25 14:04:23 -05:00
Dan McGee
ebfc46026f Fix multilib SVN link
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-25 12:12:29 -05:00
Dan McGee
ed71d525e3 Make package size fields big integers
We had a package go in today that has an installed size > 2GB, which
makes PostgreSQL blow up when trying to create the package entry.
Enlarge these fields to big integers so they can store all conceivable
package size values.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-17 09:43:40 -05:00
Dan McGee
aada299712 Add packager fields to package model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-28 14:41:13 -05:00
Dan McGee
6b4c8e63b3 Make the cache_function key a bit more descriptive
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-10 16:23:36 -05:00
Dan McGee
b6fb5e02e5 Add helper method to package to find self in testing repo
This will be useful in templates getting touched in an upcoming commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:53:03 -05:00
Dan McGee
edfdc2e38b Remove old needupdate column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:37:28 -05:00
Dan McGee
fba1d29c1b Update code to use new flag_date column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:36:50 -05:00
Dan McGee
145b80d0c6 Make flag column on packages a date
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:36:17 -05:00
Dan McGee
cb9c74eff8 Add absolute URL method for todo lists
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05 22:20:28 -05:00
Dan McGee
1a945dd137 Add mirror protocols fixture
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 18:59:39 -05:00
Dan McGee
e361a1e873 Get unit tests up and running again
We had some dependency issues between migrations that needed to be
explicitly defined in order to get things fully moving, and do to some
braindeadness in Django tests not including the project url config, we need
to do some clever business when using the url tag in the base template so
tests don't doe with a NoReverseMatch exception.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-24 17:08:00 -05:00
Dan McGee
4c96b53f2e Cache results of get_depends() and get_requiredby()
Do it in our actual cache rather than an object-level, single request cache.
300 seconds is good enough resolution to have this data right; if it is
updated everyone will see the results 5 minutes late at the most.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 01:00:18 -05:00
Dan McGee
8ba6ad8521 Add utility cache_function
This allows caching the results of an arbitrary function and its arguments
in the Django-managed cache, e.g. memcached in production.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 00:50:19 -05:00
Dan McGee
67f6bc546e Remove AutoUserMiddleware
This was having some serious effects on caching as we would always have to
access the user in the session, marking every page with a "Vary: Cookie"
header. This is the start of stamping that out. The way we get the user for
news item creation is now more similar to that from the todo lists, but not
quite. That should be adjusted to be more like the news item creation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 23:31:34 -05:00
Dan McGee
a0794a25d0 Update fixtures
We have added some repos and some fields to these guys, so update them with
what we have in production at the moment.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-16 22:47:45 -05:00
Dan McGee
408288719e Enhance base package listing in package details
Add two methods to the package class, base_package() and split_packages(),
that allow us to grab other related packages to one we are interested in.
This allows us to list the Base Package on the package details page as a
link.

With the split_packages() method, we can also now list and link all
sub-packages on the package details page; e.g. for 'kernel26' we can now
link through to 'kernel26-firmware' and 'kernel26-headers'.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-09 16:16:45 -05:00
Dan McGee
8bf0bfeac7 Use Sites framework instead of hardcoded domain name
Instead of putting 'www.archlinux.org' all over the place, use the Django
sites framework to pull the site name out of the database. Now these
amazing things will work if you are running locally and decide to change the
site!

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08 08:35:58 -05:00
Dan McGee
4740c39603 Add filename column to package model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 10:11:59 -05:00
Dan McGee
e817efad53 Merge branch 'redesign'
Conflicts:
	templates/public/download.html
2010-05-24 21:13:46 -05:00
Dan McGee
5adceb6586 Fix null field issues exposed by Django 1.1.2
Apparently Django 1.1.1 let null fields pass right through but this now
causes reporead to blow up in 1.1.2. Fix the issue and get things working
again by allowing nulls where it probably makes sense and including a
migration to fix the issue, which for the real database will be a no-op.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-24 10:57:17 -05:00
Thayer Williams
958bc63113 Add alphabetical sorting to mirrorlists
Also unify the sorting at the model-level for donors and remove the now
duplicate sorting in the admin for mirrors.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 14:49:43 -05:00
Dan McGee
0bdcc7ded0 Make CDN not dependent on DEBUG setting
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-14 17:00:23 -05:00
Dan McGee
4b7335f713 Add a hacked version of Django UpdateCacheMiddleware
This is to address a rather large issue with caching of feed objects in
Django. Because they are built up using an XML library that does multiple
writes on a file-like object, a single feed object, even when pulled from
memcached, generates 1582 writes to the open socket rather than the optimal
one it could do.

Some version of this fix will be making it upstream, but I need to figure
out how to approach that before I do so and for now this will address one of
our larger performance issues on the live site since the packages feed is
hit as often as it is.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04 10:53:40 -05:00
Dan McGee
9412ca2803 Dedupe entries in required by list
Use distinct() on a query. Fixes FS#19195.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-27 18:45:29 -05:00
Dan McGee
9b4df2b838 Migration to remove external projects
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:35:34 -05:00
Dan McGee
ec59440262 Remove Arch-Based Projects
Add a link to the wiki instead. Also remove ExternalProject model and
associated dealings.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:27:27 -05:00
Dan McGee
d9e4a36fc9 Migration to delete AltForum model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:25:56 -05:00
Dan McGee
1709def7f1 Remove International Communities
Add link to wiki instead. Also remove AltForum model and associated
dealings.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:14:53 -05:00
Dan McGee
94b735a181 Migration to remove press model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 22:56:42 -05:00
Dan McGee
8e6bb3d794 Remove Press model and admin
A link to the wiki was already present, but the model and admin had not
been removed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 22:54:10 -05:00
Dan McGee
8ea4aa21d1 Maintainer doesn't exist on package anymore
So remove it from the select_related() call on todo lists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-17 11:09:31 -05:00
Dan McGee
1113462edc Simplify code now that pkgbase is always defined
This allows some of our queries to get a lot simpler as well as removing the
pkgbase_safe property added earlier.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27 18:09:42 -05:00
Dan McGee
e317cf560a Make pkgbase non-null and indexed
Now that we always populate it, this change will make it a lot easier to use
when relating to other tables, such as our maintainer relations.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27 18:09:42 -05:00
Dan McGee
c0633aa76f Make reporead always populate pkgbase
And also add a data migration to add the value retroactively for anything
already in our database. We simply fall back to pkgname if pkgbase isn't
available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27 18:09:33 -05:00
Dan McGee
2af0ac721b Drop maintainer column off packages model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27 16:21:58 -05:00
Dan McGee
fe832ea845 Move package maintainer off of package model
This is an attempt to fix our long-standing problems dealing with maintainer
information. Move the actual maintainer information off of the package model
into a PackageRelation object, which has some flexibility to later represent
more than just maintainership.

This solves multiple problems:
* If a package gets accidentally deleted, so did the maintainer info
* Testing packages have always shown up as orphans
* With split packages, it was easy to miss some of the sub-packages

This commit does not include the deletion of the original maintainer column;
that will come at a later time when I feel more confident that the data was
migrated correctly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27 16:15:20 -05:00
Dan McGee
97202e429a Make rsync fields on mirrors optional
I think I bumbled this up a while back, but make sure they aren't required
and we use the empty string for all of those that don't provide a value.
Fixes FS#18763.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-20 14:02:38 -05:00
Dan McGee
21fe1460d4 Make the new 'testing' flag on repo a bit clearer
Since at least two repositories currently fall under this flag, add some
help text and visibility to this column.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-10 20:50:29 -06:00
Dan McGee
9374a2821c Fix up get_depends logic a bit
We were not handing depends of 'any' packages correctly if they depended on
arch-dependent packages; we labeled them all as virtual. If we have an 'any'
package, drop the arch screening and just pick one to link to.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06 16:03:41 -06:00
Dan McGee
d4155f7d0f Use repo.testing flag instead of test-based checks
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06 15:37:02 -06:00
Dan McGee
96b4c52f6d Add a flag to the repo to indicate its 'testing' status
This will eventually lead into a cleanup where we don't do checks on the
repo name all over the place like we currently do.

There are two migrations involved here; one to add the column and one to
deduce the correct value from the existing names of the repos.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06 15:36:20 -06:00
Dan McGee
05d0b8232e Fix get_depends() method description
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06 15:29:43 -06:00