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. create_template_postgis-ubuntu_lucid by clawlor 10 years, 7 months ago
  2. PostgreSQL fulltext with language translations by diverman 10 years, 8 months ago
  3. Drop all tables in MySQL database by mpasternacki 11 years, 2 months ago
  4. grep and delete sqlite tables by kifkif 11 years, 4 months ago
  5. Substitute hyphens with spaces to enale URLs to reference to multi-word tags by miernik 11 years, 5 months ago

Comments

Please login first before commenting.