Permalink
Browse files

use split_contents and fix docs for right namings

  • Loading branch information...
1 parent 5f7691d commit 4a709e51feb96029fd2345f5c14cc1939f6000f8 @gnunicorn committed Apr 27, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 actstream/templatetags/activity_tags.py
@@ -60,7 +60,7 @@ def handle_token(cls, parser, token):
"""
Class method to parse and return a Node.
"""
- bits = token.contents.split()
+ bits = token.split_contents()
args_count = len(bits) - 1
if args_count >= 2 and bits[-2] == 'as':
as_var = bits[-1]
@@ -130,12 +130,12 @@ def follow_url(parser, tokens):
Example::
- <a href="{% activity_follow_url request.user %}">{% actstream_follow_label request.user 'follow' 'stop following' %}</a>
+ <a href="{% follow_url request.user %}">{% follow_label request.user 'follow' 'stop following' %}</a>
"""
- bits = tokens.contents.split()
+ bits = tokens.split_contents()
if len(bits) != 2:
- raise TemplateSyntaxError, "Accepted format {% activity_follow_url [instance] %}"
+ raise TemplateSyntaxError, "Accepted format {% follow_url [instance] %}"
else:
return DisplayActivityFollowUrl(bits[1])
@@ -146,12 +146,12 @@ def follow_label(parser, tokens):
Example::
- <a href="{% activity_follow_url request.user %}">{% actstream_follow_label request.user 'follow' 'stop following' %}</a>
+ <a href="{% follow_url request.user %}">{% follow_label request.user 'follow' 'stop following' %}</a>
"""
- bits = tokens.contents.split()
+ bits = tokens.split_contents()
if len(bits) != 4:
- raise TemplateSyntaxError, "Accepted format {% activity_follow_label [instance] [follow_string] [unfollow_string] %}"
+ raise TemplateSyntaxError, "Accepted format {% follow_label [instance] [follow_string] [unfollow_string] %}"
else:
return DisplayActivityFollowLabel(*bits[1:])
@@ -165,7 +165,7 @@ def actor_url(parser, token):
<a href="{% actor_url another_user %}">{{ another_user }}'s actions</a>
"""
- bits = tokens.contents.split()
+ bits = tokens.split_contents()
if len(bits) != 4:
raise TemplateSyntaxError, "Accepted format {% actor_url [actor_instance] %}"
else:

0 comments on commit 4a709e5

Please sign in to comment.