diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-30 14:32:54 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-30 14:32:54 -0500 |
commit | bb84f9c96cb9df4e47e517f424a28fc36b4bed28 (patch) | |
tree | a5f2dc94861f1262a8743d3ba2c8d060be61536d | |
parent | 3ebe31bdadfcb9c6571b250e53da1f7dd7ebeb66 (diff) |
Use new is_download field
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | mirrors/utils.py | 2 | ||||
-rw-r--r-- | mirrors/views.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mirrors/utils.py b/mirrors/utils.py index 0463247a..a26b19ce 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -10,7 +10,7 @@ default_cutoff = datetime.timedelta(hours=24) @cache_function(300) def get_mirror_statuses(cutoff=default_cutoff): cutoff_time = datetime.datetime.utcnow() - cutoff - protocols = MirrorProtocol.objects.exclude(protocol__iexact='rsync') + protocols = list(MirrorProtocol.objects.filter(is_download=True)) # I swear, this actually has decent performance... urls = MirrorUrl.objects.select_related('mirror', 'protocol').filter( mirror__active=True, mirror__public=True, diff --git a/mirrors/views.py b/mirrors/views.py index 34385a98..24ca0324 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -25,7 +25,7 @@ class MirrorlistForm(forms.Form): self.fields['country'].choices = make_choice(mirrors) self.fields['country'].initial = ['Any'] protos = make_choice( - MirrorProtocol.objects.exclude(protocol__iexact='rsync')) + MirrorProtocol.objects.filter(is_download=True)) self.fields['protocol'].choices = protos self.fields['protocol'].initial = [t[0] for t in protos] @@ -45,8 +45,8 @@ def generate_mirrorlist(request): def find_mirrors(request, countries=None, protocols=None, use_status=False): if not protocols: - protocols = MirrorProtocol.objects.exclude( - protocol__iexact='rsync').values_list('protocol', flat=True) + protocols = MirrorProtocol.objects.filter( + is_download=True).values_list('protocol', flat=True) qset = MirrorUrl.objects.select_related().filter( protocol__protocol__in=protocols, mirror__public=True, mirror__active=True, mirror__isos=True |