Permalink
Browse files

cleaned up flagtags.py

  • Loading branch information...
1 parent 24af7e3 commit 863384a5fa826ff8e118e68d56796f7f2665e2f4 @brosner brosner committed Apr 19, 2010
Showing with 12 additions and 9 deletions.
  1. +12 −9 flag/templatetags/flagtags.py
@@ -2,17 +2,20 @@
from django.contrib.contenttypes.models import ContentType
+
register = template.Library()
+
+@register.inclusion_tag("flag/flag_form.html", takes_context=True)
def flag(context, content_object, creator_field):
- content_type = ContentType.objects.get(app_label=content_object._meta.app_label, model=content_object._meta.module_name)
+ content_type = ContentType.objects.get(
+ app_label = content_object._meta.app_label,
+ model = content_object._meta.module_name
+ )
return {
- 'content_type': content_type.id,
- 'object_id': content_object.id,
- 'creator_field': creator_field,
- 'request': context['request'],
- 'user': context['user'],
+ "content_type": content_type.id,
+ "object_id": content_object.id,
+ "creator_field": creator_field,
+ "request": context["request"],
+ "user": context["user"],
}
-
-
-register.inclusion_tag('flag/flag_form.html', takes_context=True)(flag)

0 comments on commit 863384a

Please sign in to comment.