diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-22 21:33:46 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-12-22 21:33:46 -0500 |
commit | bad36ff78ead3ad4868227f8120a9ef0cefd1365 (patch) | |
tree | b06a8fb740915592e86475bd7ed390866a469c87 /mirrors | |
parent | 3b40bcb3fbd21a50faa5cc7a21714c6dab158cb5 (diff) | |
parent | 97ca3f7286a533c7a5e7935c034578c06235571a (diff) |
Merge commit '97ca3f7' into archweb-generic (bugtracker/mirror integration)
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/admin.py | 3 | ||||
-rw-r--r-- | mirrors/migrations/0027_auto__add_field_mirror_bug.py | 91 | ||||
-rw-r--r-- | mirrors/models.py | 1 |
3 files changed, 94 insertions, 1 deletions
diff --git a/mirrors/admin.py b/mirrors/admin.py index e35d9ce7..17365486 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -54,7 +54,7 @@ class MirrorAdminForm(forms.ModelForm): model = Mirror fields = ('name', 'tier', 'upstream', 'admin_email', 'alternate_email', 'public', 'active', 'isos', 'rsync_user', 'rsync_password', - 'notes') + 'bug', 'notes') upstream = forms.ModelChoiceField( queryset=Mirror.objects.filter(tier__gte=0, tier__lte=1), @@ -67,6 +67,7 @@ class MirrorAdmin(admin.ModelAdmin): 'isos', 'admin_email', 'alternate_email') list_filter = ('tier', 'active', 'public') search_fields = ('name', 'admin_email', 'alternate_email') + readonly_fields = ('created',) inlines = [ MirrorUrlInlineAdmin, MirrorRsyncInlineAdmin, diff --git a/mirrors/migrations/0027_auto__add_field_mirror_bug.py b/mirrors/migrations/0027_auto__add_field_mirror_bug.py new file mode 100644 index 00000000..f7304ba8 --- /dev/null +++ b/mirrors/migrations/0027_auto__add_field_mirror_bug.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + def forwards(self, orm): + db.add_column(u'mirrors_mirror', 'bug', + self.gf('django.db.models.fields.PositiveIntegerField')(null=True), + keep_default=False) + # UPDATE mirrors_mirror m + # SET bug = ( + # SELECT extracted::int FROM ( + # SELECT id, substring(notes from 'FS#([\d]+)') AS extracted FROM mirrors_mirror + # ) a + # WHERE extracted IS NOT NULL AND a.id = m.id + # ) + # WHERE notes LIKE '%FS#%'; + + def backwards(self, orm): + db.delete_column(u'mirrors_mirror', 'bug') + + + models = { + u'mirrors.checklocation': { + 'Meta': {'ordering': "('hostname', 'source_ip')", 'object_name': 'CheckLocation'}, + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'source_ip': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}) + }, + u'mirrors.mirror': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Mirror'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'admin_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'blank': 'True'}), + 'alternate_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'blank': 'True'}), + 'bug': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'isos': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'rsync_password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'rsync_user': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '50', 'blank': 'True'}), + 'tier': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}), + 'upstream': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mirrors.Mirror']", 'null': 'True', 'on_delete': 'models.SET_NULL'}) + }, + u'mirrors.mirrorlog': { + 'Meta': {'object_name': 'MirrorLog'}, + 'check_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'duration': ('django.db.models.fields.FloatField', [], {'null': 'True'}), + 'error': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_success': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'last_sync': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'null': 'True', 'to': u"orm['mirrors.CheckLocation']"}), + 'url': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'logs'", 'to': u"orm['mirrors.MirrorUrl']"}) + }, + u'mirrors.mirrorprotocol': { + 'Meta': {'ordering': "('protocol',)", 'object_name': 'MirrorProtocol'}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'default': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_download': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'protocol': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}) + }, + u'mirrors.mirrorrsync': { + 'Meta': {'ordering': "('ip',)", 'object_name': 'MirrorRsync'}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip': ('mirrors.fields.IPNetworkField', [], {'max_length': '44'}), + 'mirror': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rsync_ips'", 'to': u"orm['mirrors.Mirror']"}) + }, + u'mirrors.mirrorurl': { + 'Meta': {'object_name': 'MirrorUrl'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'country': ('django_countries.fields.CountryField', [], {'db_index': 'True', 'max_length': '2', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'has_ipv4': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'has_ipv6': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mirror': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'urls'", 'to': u"orm['mirrors.Mirror']"}), + 'protocol': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'urls'", 'on_delete': 'models.PROTECT', 'to': u"orm['mirrors.MirrorProtocol']"}), + 'url': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + } + } + + complete_apps = ['mirrors'] diff --git a/mirrors/models.py b/mirrors/models.py index da3d8c0d..47e2051b 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -28,6 +28,7 @@ class Mirror(models.Model): isos = models.BooleanField("ISOs", default=True) rsync_user = models.CharField(max_length=50, blank=True, default='') rsync_password = models.CharField(max_length=50, blank=True, default='') + bug = models.PositiveIntegerField("Flyspray bug", null=True, blank=True) notes = models.TextField(blank=True) created = models.DateTimeField(editable=False) |