Piki is a minimal wiki
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 570B

1234567891011121314151617181920
  1. from django.urls.base import reverse
  2. def url_page(request, rel_path, **kwargs):
  3. params = "&".join([f"{key}" + ("" if kwargs[key] is None else f"={kwargs[key]}") for key in kwargs])
  4. if len(params) > 0:
  5. params = "?" + params
  6. return reverse('page-page', kwargs={'rel_path': rel_path}) + params
  7. def url_helpview(request, page):
  8. return reverse('page-helpview', kwargs={'page': page})
  9. def url_edit(request, rel_path):
  10. return reverse('page-edit', kwargs={'rel_path': rel_path})
  11. def get_search_query(request):
  12. return request.GET.get('q')