summaryrefslogtreecommitdiff
path: root/main/models.py
AgeCommit message (Collapse)Author
2010-10-04Make user profile a OneToOneFieldrelease_2010-10-05Dan McGee
We had this set up as a unique ForeignKey before, which adds some indirection due to the RelatedManager object being there. By making it a OneToOneField, we can get the profile object directly, enforce uniqueness, and also use it in select_related() calls to make our profiles page a bit more efficient. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-04Todo list minor fixes and comments for laterDan McGee
When we show the edit todo list page, use a sorted list retrieved straight from the database instead of a unordered set() we create at the application level. Also add some comments for potential later improvements on transaction boundaries and async emailing. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-01Allow donors to be invisiblerelease_2010-10-01Dan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22Update BBS and bugs links to use HTTPSDan McGee
Since we only do HTTPS now on these services, no point in sending someone through a useless redirect. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-16Remove some leftover print statementsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Use arch.agnostic flag everywhereDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Add metadata to Arch tableDan McGee
Add a column flagging whether this architecture is agnostic (e.g. 'any') or not. This will remove the hardcoded name checks we have all over the place and replace it with a boolean. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Move news model to an appropriate placeDan McGee
Never would have guessed it should actually be in news/models.py. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06Move mirror models out of main appDan McGee
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-06Remove unnecessary commentsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03Add ability to get versions of a package elsewhereDan McGee
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-08-28PyLint suggested cleanupsDan McGee
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-25Use new repository fields in link generation coderelease_2010-08-25Dan McGee
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-25Add more metadata to repo modelDan McGee
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-25Fix multilib SVN linkDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-17Make package size fields big integersDan McGee
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-07-28Add packager fields to package modelDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06Add helper method to package to find self in testing repoDan McGee
This will be useful in templates getting touched in an upcoming commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06Remove old needupdate columnDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06Update code to use new flag_date columnDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06Make flag column on packages a dateDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05Add absolute URL method for todo listsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21Cache results of get_depends() and get_requiredby()release_2010-06-21Dan McGee
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-20Remove AutoUserMiddlewareDan McGee
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-09Enhance base package listing in package detailsrelease_2010-06-10Dan McGee
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-08Use Sites framework instead of hardcoded domain nameDan McGee
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-05-26Add filename column to package modelDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-24Merge branch 'redesign'Dan McGee
Conflicts: templates/public/download.html
2010-05-24Fix null field issues exposed by Django 1.1.2Dan McGee
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-17Add alphabetical sorting to mirrorlistsThayer Williams
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-04-27Dedupe entries in required by listDan McGee
Use distinct() on a query. Fixes FS#19195. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18Remove Arch-Based ProjectsDan McGee
Add a link to the wiki instead. Also remove ExternalProject model and associated dealings. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18Remove International CommunitiesDan McGee
Add link to wiki instead. Also remove AltForum model and associated dealings. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18Remove Press model and adminDan McGee
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-17Maintainer doesn't exist on package anymoreDan McGee
So remove it from the select_related() call on todo lists. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27Simplify code now that pkgbase is always definedrelease_2010-03-28Dan McGee
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-27Make pkgbase non-null and indexedDan McGee
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-27Drop maintainer column off packages modelDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-27Move package maintainer off of package modelDan McGee
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-20Make rsync fields on mirrors optionalrelease_2010-03-20Dan McGee
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-10Make the new 'testing' flag on repo a bit clearerrelease_2010-03-10Dan McGee
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-06Fix up get_depends logic a bitDan McGee
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-06Use repo.testing flag instead of test-based checksDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06Add a flag to the repo to indicate its 'testing' statusDan McGee
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-06Fix get_depends() method descriptionDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06Make mirror notes a text fieldrelease_2010-03-06Dan McGee
Rather than a short 255 character field. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06Kill rsync IP hostname fieldDan McGee
This wasn't strictly necessary and was more hassle than it was worth. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06Add mirror rsync credentials dataDan McGee
Allow this to be stored in the database for later use by an external generation script for the rsyncd secrets file. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-06Mirror tiering enhancementsDan McGee
Add ability to track tier and upstream mirror in the database. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-27Add a files_last_update columnDan McGee
This is necessary to keep all of our junk in sync since we aren't guaranteed to have an up to date files database all the time. Signed-off-by: Dan McGee <dan@archlinux.org>