mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 17:32:16 +00:00
Change ical to use dynamically generated URL's instead of a static base URL.
This commit is contained in:
@@ -112,8 +112,8 @@ class CalendarICS(ICalFeed):
|
|||||||
|
|
||||||
def item_link(self, item):
|
def item_link(self, item):
|
||||||
# Make a link to the event in the web interface
|
# Make a link to the event in the web interface
|
||||||
base_url = "https://pyrigs.nottinghamtec.co.uk"
|
# base_url = "https://pyrigs.nottinghamtec.co.uk"
|
||||||
return base_url+str(reverse_lazy('event_detail',kwargs={'pk':item.pk}))
|
return item.get_absolute_url()
|
||||||
|
|
||||||
# def item_created(self, item): #TODO - Implement created date-time (using django-reversion?) - not really necessary though
|
# def item_created(self, item): #TODO - Implement created date-time (using django-reversion?) - not really necessary though
|
||||||
# return ''
|
# return ''
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from django.utils.encoding import python_2_unicode_compatible
|
|||||||
import reversion
|
import reversion
|
||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
|
from django.core.urlresolvers import reverse_lazy
|
||||||
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
@@ -304,6 +305,9 @@ class Event(models.Model, RevisionMixin):
|
|||||||
|
|
||||||
objects = EventManager()
|
objects = EventManager()
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse_lazy('event_detail', kwargs={'pk': self.pk})
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.pk) + ": " + self.name
|
return str(self.pk) + ": " + self.name
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user