diff options
author | Dan McGee <dan@archlinux.org> | 2014-10-19 14:08:15 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-10-19 14:08:15 -0500 |
commit | 7c26f6b7a4d29faede58d2feb13ef961e4725637 (patch) | |
tree | 2279b67ee216ed0281221a62bb3b7754fe12a544 | |
parent | 9589a7eadeb05e82c2d63f6fe128316fdb6dcc8a (diff) |
Use raw DB query to fetch last modified date
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | mirrors/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mirrors/views.py b/mirrors/views.py index 26b5b802..55c40c4d 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -6,6 +6,7 @@ from operator import attrgetter, itemgetter from django import forms from django.forms.widgets import CheckboxSelectMultiple from django.core.serializers.json import DjangoJSONEncoder +from django.db import connection from django.db.models import Q from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404, redirect, render @@ -222,7 +223,9 @@ def url_details(request, name, url_id): def status_last_modified(request, *args, **kwargs): - return MirrorLog.objects.values_list('check_time', flat=True).latest() + cursor = connection.cursor() + cursor.execute("SELECT MAX(check_time) FROM mirrors_mirrorlog") + return cursor.fetchone()[0] @condition(last_modified_func=status_last_modified) |