summaryrefslogtreecommitdiff
path: root/main/admin.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-03-06 09:42:08 -0600
committerDan McGee <dan@archlinux.org>2010-03-06 10:13:28 -0600
commit93e0552e3dcaa3b2feb82a5dddc0ae43d82eeee0 (patch)
tree96f0ab9a89458692a209597efca6c52fd2ce366d /main/admin.py
parentcefb969d3c7d0d0380f63fcd50906be3b2825b4d (diff)
Mirror tiering enhancements
Add ability to track tier and upstream mirror in the database. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/admin.py')
-rw-r--r--main/admin.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/admin.py b/main/admin.py
index 1de07c88..b42c891f 100644
--- a/main/admin.py
+++ b/main/admin.py
@@ -52,9 +52,15 @@ class MirrorRsyncInlineAdmin(admin.TabularInline):
form = MirrorRsyncForm
extra = 2
+class MirrorAdminForm(forms.ModelForm):
+ class Meta:
+ model = Mirror
+ upstream = forms.ModelChoiceField(queryset=Mirror.objects.filter(tier__gte=0, tier__lte=1), required=False)
+
class MirrorAdmin(admin.ModelAdmin):
- list_display = ('name', 'country', 'active', 'public', 'isos', 'admin_email', 'supported_protocols')
- list_filter = ('country', 'active', 'public')
+ form = MirrorAdminForm
+ list_display = ('name', 'tier', 'country', 'active', 'public', 'isos', 'admin_email', 'supported_protocols')
+ list_filter = ('tier', 'country', 'active', 'public')
ordering = ['country', 'name']
search_fields = ('name',)
inlines = [