Sitemaps for page that should be public viewable

This commit is contained in:
2017-11-03 07:16:47 +01:00
parent 8719c2377a
commit 7ef69849a4
8 changed files with 72 additions and 3210 deletions

View File

@@ -0,0 +1,17 @@
"""To geneate a Sitemap with all events."""
from kasu.sitemaps import GenericSitemap
from django.utils import timezone
from django.urls import reverse
from events.models import Event
class MaistarGamesSitemap(GenericSitemap):
@staticmethod
def items():
"""add all upcoming and archived events to the sitemap."""
return Event.objects.all().exclude(maistargame_set=None)
@staticmethod
def location(event):
return reverse('maistar-game-list', kwargs={'event': event.id})