Author: leidel
Date: Sat Sep 27 17:55:23 2008
New Revision: 174
Modified:
trunk/wiki/templatetags/wikiurl.py
Log:
Fixed the wikiurl tag to modify the context correctly and resolve the
passed article and revision variables correctly
Modified: trunk/wiki/templatetags/wikiurl.py
==============================================================================
--- trunk/wiki/templatetags/wikiurl.py (original)
+++ trunk/wiki/templatetags/wikiurl.py Sat Sep 27 17:55:23 2008
@@ -36,13 +36,13 @@
url = ''
try:
- url = reverse(self.url_name, urlconf, kwargs=kw)
- return ''.join(['/', app, url]) # @@@ hardcoding
/app_name/wiki_url/
+ url_bits = ['/', app, reverse(self.url_name, urlconf,
kwargs=kw)]
+ url = ''.join(url_bits) # @@@ hardcoding /app_name/wiki_url/
except NoReverseMatch, err:
if self.asvar is None:
raise
- if self.asvar:
+ if self.asvar is not None:
context[self.asvar] = url
return ''
else:
@@ -96,8 +96,8 @@
if bits[3] == "as":
kwargs['asvar'] = bits[4]
else:
- kwargs['article'] = bits[3]
- kwargs['revision'] = bits[4]
+ kwargs['article'] = parser.compile_filter(bits[3])
+ kwargs['revision'] = parser.compile_filter(bits[4])
elif len(bits) == 6: # {% wikiurl url_name group article as var %}
if bits[4] == "as":
raise TemplateSyntaxError("4th argument to %s should
be 'as'" % bits[0])
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---