summaryrefslogtreecommitdiffstats
path: root/main/models.py
AgeCommit message (Collapse)AuthorFilesLines
2011-07-30Select arch/repo for split package related fieldsDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-06Delete old signoff modelDan McGee1-6/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-06Refactor code to use new signoff modelDan McGee1-8/+6
This moves signoff creation and display to the new packages.Signoff model. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05Allow more lenient data entry for PGP key fieldDan McGee1-1/+20
Don't allow the max_length parameter to make it through to the HTML form, silently cutting off HTML cut and pastes. Trim out spaces automatically, as well as '0x' and '2048R/' type prefixes. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Fix syntax errors, == not =Dan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Add Package.in_staging methodDan McGee1-0/+11
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Set up queries for staging reposDan McGee1-6/+11
This treats repo.staging special in much the way we already have to treat repo.testing as special. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Revert "Remove unused flagged() manager method"Dan McGee1-0/+4
Far from unneeded, this is used on the developer dashboard. Silly me. Document this fact as well in the code so we don't screw it up again. This reverts commit 2a44855556531a27e949884d4084c6e5d37082e1.
2011-06-15Remove unused flagged() manager methodDan McGee1-3/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Refactor common select_related into manager methodDan McGee1-5/+6
For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15PositiveBigIntegerField: set get_internal_type() correctlyDan McGee1-1/+1
This is a key for Django to return the DB type that matches this value. Since we are basically just ripping off a BigIntegerField, we can use the database types for it. This makes my prior checked in migrations actually work on MySQL. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Mark several package columns as non-NULLDan McGee1-4/+14
These have been around for a long time now so they don't need to be NULL-able anymore. We can also add a custom field type for our numbers to at least get a check constraint at the Django level. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-02Add a PGP key field on the dev profileDan McGee1-0/+13
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-09Ensure required by works for arch-agnostic packagesDan McGee1-2/+5
We weren't showing required by entries for arch-specific packages that depended on arch-agnostic ones. Make the check a bit less specific for arch-agnostic packages similar to what we do for dependencies. Fixes FS#24184. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-19Reimplement links code as template tagsDan McGee1-24/+0
These were starting to get a bit too much inside the model itself, and they don't really belong there as they are view layer concerns anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-19Add a "Report a Bug" linkDan McGee1-0/+11
We need Flyspray category data to make this more useful, and we can prefill the Subject and Category fields (along with putting it on the right project). Implements FS#23751. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Utilize Django 1.3 'on_delete' feature on several foreign keysDan McGee1-4/+7
The most important one here is PROTECT to keep people from making bone-headed plays and deleting an Arch or Repo and every package along with it. We can use this in a few other places, as well as some carefully placed SET_NULL indicators. Note that nothing here pushes deletion responsibilities down to the database, although that will probably happen in a future commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Consolidate caching black magicDan McGee1-4/+3
Get the stuff used to retrieve and refresh the latest date values all in the same place, and make it a bit more beautiful by refactoring it all into a common set of methods. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Use UTC datetime objects everywhereDan McGee1-2/+11
Rather than the twisted mix of local times and UTC times we currently have. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Fix potential logic bug in requiredby filteringDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add 'staging' field to Repo modelDan McGee1-0/+2
First steps towards implementing FS#23298. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add index to todo list date addedDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-15Check in actual models update for DateTime migrationDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-13Show epoch in package version if != 0Dan McGee1-0/+6
Add a full_version property method to our package object that does the version formatting, and switch all templates displaying package versions over to this new method. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-13Add package epoch supportDan McGee1-1/+3
This comes with pacman 3.5, replacing the old "force" PKGBUILD option. We parse it and store it for now, but don't display it anywhere just yet. Also update a few queries relying on version differences in any of the multiple parts. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-22Use new split package file fields everywhereDan McGee1-2/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-22Add new file and directory parts to package filesDan McGee1-0/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-19Unify calls to applicable_arches()Dan McGee1-1/+1
Invoke the function everywhere it is used rather than passing a callable. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-17Allow for optional info in required by displayDan McGee1-13/+18
We need to make our root object the PackageDepend rather than the Package to get at this, so do a slight refactor on get_requiredby(). Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-17Read in optional deps and show in web interfaceDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-15Move license to a related modelDan McGee1-1/+0
This allows us to store multiple licenses per package in a more elegant fashion, and will later allow us to search and filter on this information. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-15Allow optional deps in depends modelDan McGee1-0/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
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>