Eliminated unnecessary ContentType queries that used applabel/model-based lookups.
[philo.git] / philo / contrib / julian / models.py
index 33c6e2a..fd0a7c5 100644 (file)
@@ -15,8 +15,8 @@ from django.http import HttpResponse, Http404
 from django.utils.encoding import force_unicode
 
 from philo.contrib.julian.feedgenerator import ICalendarFeed
 from django.utils.encoding import force_unicode
 
 from philo.contrib.julian.feedgenerator import ICalendarFeed
-from philo.contrib.syndication.models import FeedView
-from philo.contrib.syndication.feeds import registry
+from philo.contrib.winer.models import FeedView
+from philo.contrib.winer.feeds import registry
 from philo.exceptions import ViewCanNotProvideSubpath
 from philo.models import Tag, Entity, Page
 from philo.models.fields import TemplateField
 from philo.exceptions import ViewCanNotProvideSubpath
 from philo.models import Tag, Entity, Page
 from philo.models.fields import TemplateField
@@ -334,7 +334,7 @@ class CalendarView(FeedView):
        
        def get_events_by_location(self, request, app_label, model, pk, extra_context=None):
                try:
        
        def get_events_by_location(self, request, app_label, model, pk, extra_context=None):
                try:
-                       ct = ContentType.objects.get(app_label=app_label, model=model)
+                       ct = ContentType.objects.get_by_natural_key(app_label, model)
                        location = ct.model_class()._default_manager.get(pk=pk)
                except ObjectDoesNotExist:
                        raise Http404
                        location = ct.model_class()._default_manager.get(pk=pk)
                except ObjectDoesNotExist:
                        raise Http404