summaryrefslogtreecommitdiffstats
path: root/main/models.py
AgeCommit message (Collapse)AuthorFilesLines
2011-02-15Clean up Package related objects codeDan McGee1-5/+9
Main change is just to move groups from the default packagegroup_set location to a related_name of groups. Also refer to the Package class directly rather than by text string if we have it available. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-09Use common timezones onlyDan McGee1-1/+1
No need to show historical and deprecated zone names. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-08Merge branch 'dev-timezones'Dan McGee1-1/+7
2011-01-08Remove automatic ID column definitionsDan McGee1-9/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-08Add time zone field to developer profileDan McGee1-2/+7
This will be used by the developer world clock page soon to come. Default everyone to "UTC" for now. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-14Get rid of all references to repos.archlinux.orgThomas Bächler1-1/+1
The packages/community repositories can now be viewed via cgit. Point links to cgit instead of websvn, as websvn is buggy and nobody wants to maintain it. This allows us to get rid of websvn entirely. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-07Slim down required by listingsDan McGee1-6/+33
If we have testing/non-testing packages in this list, and we are looking at a package that is in both testing and non-testing, we can show only the packages that correspond with the relevant repo. I'm not sure any explanation will make this easier to understand, but the end result is we don't show a bunch of duplicates where we used to. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-07Save DB query when filtering dependencies for testingDan McGee1-4/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-07Move some common package code to a functionDan McGee1-7/+10
We do this determination of 'applicable arches' a few times, so move it to a method on the package object and also clean things up so items aren't duplicated in the list. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-11-27Add less-than methods for Repo and ArchDan McGee1-0/+6
These are the methods guaranteed to be used by the python sort functions; define them so we can simplify sorting code elsewhere as needed. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-19Unify hyphenation of out-of-date textDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-14Connect post_save signals where they will always be triggeredDan McGee1-0/+6
We need to do this in the models.py files, otherwise the post_save signal might not be connected right away on launch of the application. Move them over there, add a dispatch_uid so it only gets hooked up once, and do some other function moving around so we don't have circular imports. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-05Adding changing of user profile detailsAngel Velasquez1-2/+3
The idea of this patch is allow to the developers who have an account, to change their data without asking some admin to do it for them. Dan: put private email address field back as it is used for a different purpose; add some help text and field names as appropriate. Signed-off-by: Angel Velasquez <angvp@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-05Make user profile a OneToOneFieldDan McGee1-2/+1
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 McGee1-1/+2
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 invisibleDan McGee1-0/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-23Update BBS and bugs links to use HTTPSDan McGee1-1/+1
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-17Remove some leftover print statementsDan McGee1-2/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Use arch.agnostic flag everywhereDan McGee1-4/+9
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08Add metadata to Arch tableDan McGee1-0/+5
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 McGee1-17/+0
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 McGee1-54/+0
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 McGee1-9/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03Add ability to get versions of a package elsewhereDan McGee1-0/+7
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 McGee1-3/+2
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 codeDan McGee1-13/+2
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 McGee1-1/+6
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 McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-17Make package size fields big integersDan McGee1-2/+3
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 McGee1-0/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07Add helper method to package to find self in testing repoDan McGee1-0/+10
This will be useful in templates getting touched in an upcoming commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07Remove old needupdate columnDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07Update code to use new flag_date columnDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07Make flag column on packages a dateDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06Add absolute URL method for todo listsDan McGee1-0/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21Cache results of get_depends() and get_requiredby()Dan McGee1-5/+3
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-21Remove AutoUserMiddlewareDan McGee1-3/+1
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 detailsDan McGee1-0/+30
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 McGee1-0/+7
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 McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-25Merge branch 'redesign'Dan McGee1-0/+7
Conflicts: templates/public/download.html
2010-05-24Fix null field issues exposed by Django 1.1.2Dan McGee1-3/+3
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 Williams1-0/+7
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-28Dedupe entries in required by listDan McGee1-1/+1
Use distinct() on a query. Fixes FS#19195. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-19Remove Arch-Based ProjectsDan McGee1-8/+0
Add a link to the wiki instead. Also remove ExternalProject model and associated dealings. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-19Remove International CommunitiesDan McGee1-11/+0
Add link to wiki instead. Also remove AltForum model and associated dealings. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-19Remove Press model and adminDan McGee1-10/+0
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 McGee1-1/+1
So remove it from the select_related() call on todo lists. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-28Simplify code now that pkgbase is always definedDan McGee1-8/+2
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-28Make pkgbase non-null and indexedDan McGee1-1/+1
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>