Browse files

Template tag changes.

  • Loading branch information...
1 parent cb080bf commit 4da23b62835a88924d6f634739ac045e757eeadb @lukeman lukeman committed Nov 21, 2010
Showing with 5 additions and 26 deletions.
  1. +5 −26 mimesis_project/apps/mimesis/templatetags/
@@ -9,12 +9,12 @@
class BaseMediaNode(template.Node):
- Base helper class (abstract) for handling the get_media_* template tags.
+ Base helper class (abstract) for handling the get_media_for template tags.
def handle_token(cls, parser, token, model):
- """Class method to parse get_*_list/count and return a Node."""
+ """Class method to parse get_media_list and return a Node."""
tokens = token.contents.split()
if tokens[1] != 'for':
@@ -101,37 +101,16 @@ def get_context_value_from_queryset(self, context, qs):
return list(qs)
-class MediaCountNode(BaseMediaNode):
- """Insert a count of media into the context."""
- def get_context_value_from_queryset(self, context, qs):
- return qs.count()
-def get_image_count(parser, token):
- return MediaCountNode.handle_token(parser, token, ImageAssociation)
-def get_image_list(parser, token):
+def get_images_for(parser, token):
return MediaListNode.handle_token(parser, token, ImageAssociation)
-def get_audio_count(parser, token):
- return MediaCountNode.handle_token(parser, token, AudioAssociation)
-def get_audio_list(parser, token):
+def get_audio_for(parser, token):
return MediaListNode.handle_token(parser, token, AudioAssociation)
-def get_video_count(parser, token):
- return MediaCountNode.handle_token(parser, token, VideoAssociation)
-def get_video_list(parser, token):
+def get_videos_for(parser, token):
return MediaListNode.handle_token(parser, token, VideoAssociation)

0 comments on commit 4da23b6

Please sign in to comment.