Sitemaps for page that should be public viewable
This commit is contained in:
17
src/maistar_ranking/sitemaps.py
Normal file
17
src/maistar_ranking/sitemaps.py
Normal 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})
|
||||
Reference in New Issue
Block a user