Browse files

Template tags for audio and video.

  • Loading branch information...
1 parent ba47691 commit 57a6410ff41457c0b2448e95f1d48b1793a4c63c @lukeman lukeman committed Nov 18, 2010
Showing with 21 additions and 1 deletion.
  1. +21 −1 mimesis_project/apps/mimesis/templatetags/mimesis_tags.py
View
22 mimesis_project/apps/mimesis/templatetags/mimesis_tags.py
@@ -2,7 +2,7 @@
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_unicode
-from mimesis.models import ImageAssociation
+from mimesis.models import ImageAssociation, AudioAssociation, VideoAssociation
register = template.Library()
@@ -115,3 +115,23 @@ def get_image_count(parser, token):
@register.tag
def get_image_list(parser, token):
return MediaListNode.handle_token(parser, token, ImageAssociation)
+
+
+@register.tag
+def get_audio_count(parser, token):
+ return MediaCountNode.handle_token(parser, token, AudioAssociation)
+
+
+@register.tag
+def get_audio_list(parser, token):
+ return MediaListNode.handle_token(parser, token, AudioAssociation)
+
+
+@register.tag
+def get_video_count(parser, token):
+ return MediaCountNode.handle_token(parser, token, VideoAssociation)
+
+
+@register.tag
+def get_video_list(parser, token):
+ return MediaListNode.handle_token(parser, token, VideoAssociation)

0 comments on commit 57a6410

Please sign in to comment.