Login

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

Author:
miernik
Posted:
November 12, 2009
Language:
SQL
Version:
Not specified
Tags:
django tagging
Score:
0 (after 0 ratings)

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 6 years, 6 months ago
  2. default url routing and shortcut by vicalloy 5 years, 9 months ago
  3. nbsp filter by vitamon 2 years, 4 months ago
  4. Automatically create urls for templates in a directory by blackrobot 3 years, 5 months ago
  5. Truncate text to length up until the nearest space by phektus 4 years ago

Comments

Please login first before commenting.