summaryrefslogtreecommitdiffstats
path: root/mirrors/models.py
AgeCommit message (Collapse)AuthorFilesLines
2013-03-07Add 'created' field to more mirror modelsDan McGee1-2/+7
We have been better about doing this to most of our models, but the ones here didn't have a created field. Add it where appropriate and set a reasonably old default value. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-07Add mirror check locations modelDan McGee1-1/+22
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-20Lengthen the mirror rsync IP address fieldDan McGee1-2/+3
Make it long enough to support a full-form IPv6 address with a subnet. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14Drop country column from mirror tableDan McGee1-6/+1
We now always look for this information at the URL level, not the mirror level. This simplifies quite a bit of code in and around the mirror views. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-13Prefetch the available protocols on the mirror overview pageDan McGee1-5/+0
Otherwise we are doing one query per mirror, which at this point is over 100 separate queries. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-12Add get_latest_by to MirrorLog Meta classDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01Declare 'enums' at class scopeDan McGee1-8/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19mirrors: add an alternate_email columnDan McGee1-0/+1
We have a lot of these in the freeform text area in the mirror notes; attempt to make this data usable as necessary if we want to do some sort of mirror notification automation in the future. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-14Change mirror log error text to unlimited lengthDan McGee1-1/+5
Use TextField rather than a limited-length CharField; leave it up to the code filling this field to determine an appropriate length. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-26Remove now-unused NullCharFieldDan McGee1-8/+1
It would be straightforward if we just needed to remove the field class definition, but we also need to update all migrations that referenced it so we don't have problems starting and migrating from scratch. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25Finish django countries implementationDan McGee1-6/+3
* Add a migration to drop the old countries field. * Update all templates/views/utility methods to point at the new country field and dereference it as necessary. * Add the flags images to a few views where it makes sense. * Cleanup the download page layout quite a bit. * Bump the mirror status JSON version to 3; add country_code attribute. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25Add django_countries country code fields and population migrationsDan McGee1-1/+4
This adds these columns and attempts to populate them with data from our existing country column data. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25Rename mirror country fields to country_old in prep for normalizationDan McGee1-4/+4
We're going to move to using ISO 2 character codes via django countries, so start by moving the old data out of the way first. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13Don't select FTP by default in mirrorlistsDan McGee1-0/+2
More generally, add a new 'default' column to the mirror protocol model so we can determine what is selected and shown by default. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-07Various small admin touchupsDan McGee1-7/+6
* Don't capitalize things in verbose_name, Django does this automatically and uses title case * Add overrides for IP, URL, ISO, etc. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-30mirrors: do protocol formatting in templateDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Allow mirror country field to be persisted to DB as NULLDan McGee1-3/+12
You need a custom field type in Django to allow this. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-13Add optional country override for individual mirror URLsDan McGee1-0/+6
This allows a named top-level mirror to have geographically distributed URLs, e.g. kernel.org and the geo-DNS setup. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-08Utilize Django 1.3 'on_delete' feature on several foreign keysDan McGee1-2/+2
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-05Make mirror name and URLs uniqueDan McGee1-2/+2
So we don't create duplicates without knowing it in our database, like we did earlier today. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-03Add ordering to mirror protocolsDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27Auto-resolve mirror URLs on saveDan McGee1-2/+23
This prevents people from having to mess with these checkboxes at all in the admin, and we incur no delay on their initial values being correct waiting for the cron job to run. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27Auto map the protocol URL fieldDan McGee1-1/+13
And perform better validation when doing so. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-08Fix mirror check unicode functionDan McGee1-1/+1
Needed a few self. qualifiers in there. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-14Add has_ipv{4,6} to MirrorUrlPyroPeter1-0/+2
Dan: Add some more useful labels for use in the admin. Signed-off-by: PyroPeter <abi1789@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-30Add is_download field to mirror protocolsDan McGee1-0/+8
This will replace all the usages of '!= rsync' and 'is ftp or http' we have in the code with one check on a boolean flag. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-25Add a basic mirror details pageDan McGee1-0/+6
Still some work to do here, but this covers the basics of the public view we can show for mirrors and their associated data. The upstream and downstream links should be working OK to aid navigation, but right now we have some potential dead links for non-authenticated users if they click a link to a "private" mirror. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-25Make general mirror list view publicDan McGee1-1/+2
Hide some columns when not logged in because they aren't relevant for the general public, but this will work nicely as a base page for all of our known mirrors. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21Add new MirrorLog model and associated migrationDan McGee1-0/+14
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06Move mirror models out of main appDan McGee1-0/+57
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-06Put mirrors app under South controlDan McGee1-0/+0
Signed-off-by: Dan McGee <dan@archlinux.org>