Documented pretix' URL layer

This commit is contained in:
Raphael Michel
2016-05-29 18:49:04 +02:00
parent 6ce5fadee1
commit 93502777b5
5 changed files with 102 additions and 7 deletions

View File

@@ -20,10 +20,18 @@ def get_domain(organizer):
def eventreverse(obj, name, kwargs=None):
"""
Works similar to django.core.urlresolvers.reverse but takes into account that some
Works similar to ``django.core.urlresolvers.reverse`` but takes into account that some
organizers might have their own (sub)domain instead of a subpath.
:param obj: An event or organizer
Non-keyword arguments are not supported as we want do discourage using them for better
readability.
:param obj: An ``Event`` or ``Organizer`` object
:param name: The name of the URL route
:param kwargs: A dictionary of additional keyword arguments that should be used. You do not
need to provide the organizer or event slug here, it will be added automatically as
needed.
:returns: An absolute URL (including scheme and host) as a string
"""
from pretix.multidomain import subdomain_urlconf, maindomain_urlconf