Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Template tags for audio and video.

  • Loading branch information...
commit 57a6410ff41457c0b2448e95f1d48b1793a4c63c 1 parent ba47691
Luke Hatcher lukeman authored
Showing with 21 additions and 1 deletion.
  1. +21 −1 mimesis_project/apps/mimesis/templatetags/mimesis_tags.py
22 mimesis_project/apps/mimesis/templatetags/mimesis_tags.py
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.