summaryrefslogtreecommitdiff
path: root/mirrors/models.py
AgeCommit message (Collapse)Author
2013-01-14Drop country column from mirror tableDan McGee
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-12Prefetch the available protocols on the mirror overview pageDan McGee
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 McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Declare 'enums' at class scopeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18mirrors: add an alternate_email columnDan McGee
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-13Change mirror log error text to unlimited lengthDan McGee
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 McGee
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 McGee
* 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 McGee
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 McGee
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 McGee
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 McGee
* 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-29mirrors: do protocol formatting in templateDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Allow mirror country field to be persisted to DB as NULLDan McGee
You need a custom field type in Django to allow this. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-12Add optional country override for individual mirror URLsDan McGee
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-07Utilize Django 1.3 'on_delete' feature on several foreign keysDan McGee
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 McGee
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 McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27Auto-resolve mirror URLs on saveDan McGee
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 McGee
And perform better validation when doing so. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-07Fix mirror check unicode functionDan McGee
Needed a few self. qualifiers in there. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Add has_ipv{4,6} to MirrorUrlPyroPeter
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 McGee
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-24Add a basic mirror details pageDan McGee
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-24Make general mirror list view publicDan McGee
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 McGee
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-06Put mirrors app under South controlDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>