X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/ed6b9876b7abff0b2dc6266d6f769c319f358a9c..819fc766fd18514fdd45cf514efdd91739210e62:/philo/contrib/julian/models.py?ds=inline diff --git a/philo/contrib/julian/models.py b/philo/contrib/julian/models.py index 5c49c7e..e4e78ba 100644 --- a/philo/contrib/julian/models.py +++ b/philo/contrib/julian/models.py @@ -1,3 +1,6 @@ +import calendar +import datetime + from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.contrib.auth.models import User @@ -10,19 +13,20 @@ from django.db import models from django.db.models.query import QuerySet from django.http import HttpResponse, Http404 from django.utils.encoding import force_unicode + from philo.contrib.julian.feedgenerator import ICalendarFeed -from philo.contrib.penfield.models import FeedView, FEEDS +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, TemplateField +from philo.models import Tag, Entity, Page +from philo.models.fields import TemplateField from philo.utils import ContentTypeRegistryLimiter -import datetime, calendar __all__ = ('register_location_model', 'unregister_location_model', 'Location', 'TimedModel', 'Event', 'Calendar', 'CalendarView',) -ICALENDAR = ICalendarFeed.mime_type -FEEDS[ICALENDAR] = ICalendarFeed +registry.register(ICalendarFeed, verbose_name="iCalendar") try: DEFAULT_SITE = Site.objects.get_current() except: @@ -457,5 +461,4 @@ class CalendarView(FeedView): return u"%s for %s" % (self.__class__.__name__, self.calendar) field = CalendarView._meta.get_field('feed_type') -field._choices += ((ICALENDAR, 'iCalendar'),) -field.default = ICALENDAR \ No newline at end of file +field.default = registry.get_slug(ICalendarFeed, field.default) \ No newline at end of file