Substitute hyphens with spaces to enale URLs to reference to multi-word tags

1
2
3
4
5
6
def list_tag(request, tag):
    from re import sub
    tag = sub('-',' ',tag)
    query_tag = Tag.objects.get(name=tag)
    events = TaggedItem.objects.get_by_model(Event, query_tag)
    events = events.order_by('-start')

More like this

  1. Frequently used tags/filters for Jinja2 by mathwizard 3 years, 4 months ago
  2. default url routing and shortcut by vicalloy 2 years, 8 months ago
  3. Avoid widows using a template filter by jcroft 4 years, 11 months ago
  4. Automatically create urls for templates in a directory by blackrobot 3 months, 1 week ago
  5. Profanity Check by menendez 2 years, 6 months ago

Comments

(Forgotten your password?)