aboutsummaryrefslogtreecommitdiff
path: root/feeds.py
diff options
context:
space:
mode:
Diffstat (limited to 'feeds.py')
-rw-r--r--feeds.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/feeds.py b/feeds.py
index dde051b..2f6c586 100644
--- a/feeds.py
+++ b/feeds.py
@@ -21,6 +21,7 @@ from django.db.models.functions import ExtractWeek, ExtractYear
from django.template import loader
from django.urls import reverse
from django.utils.feedgenerator import Atom1Feed, SyndicationFeed
+from django.utils.timezone import get_current_timezone_name
from icalendar import Calendar, Event
@@ -39,6 +40,11 @@ class IcalFeedGenerator(SyndicationFeed):
calendar = Calendar()
calendar.add("prodid", "-//celcatsanitizer//NONSGML v1.0//EN")
calendar.add("version", "2.0")
+ calendar.add("calscale", "GREGORIAN")
+ calendar.add("method", "PUBLISH")
+ calendar.add("x-wr-timezone", get_current_timezone_name())
+ calendar.add("x-wr-calname", self.feed["title"])
+ calendar.add("x-wr-caldesc", self.feed["title"])
self.write_events(calendar)
outfile.write(calendar.to_ical())
@@ -92,6 +98,9 @@ class IcalFeed(Feed):
"summary": self.item_summary(item),
"location": format_rooms(item.rooms.all())}
+ def title(self, obj):
+ return "Emploi du temps du groupe {0}".format(obj)
+
class IcalOnlyOneFeed(IcalFeed):
def items(self, obj):