Permalink
Browse files

added missing file from a previous commit

  • Loading branch information...
1 parent bd96390 commit 3b9e7fc01b44aa5f980ae8a549eb3a926500cb0b @brosner brosner committed Jan 12, 2010
Showing with 29 additions and 0 deletions.
  1. +29 −0 aiteo/groups.py
View
@@ -0,0 +1,29 @@
+from django.core.exceptions import ObjectDoesNotExist
+from django.http import Http404
+
+
+
+def group_and_bridge(kwargs):
+ """
+ Given kwargs from the view (with view specific keys popped) pull out the
+ bridge and fetch group from database.
+ """
+
+ bridge = kwargs.pop("bridge", None)
+
+ if bridge:
+ try:
+ group = bridge.get_group(**kwargs)
+ except ObjectDoesNotExist:
+ raise Http404
+ else:
+ group = None
+
+ return group, bridge
+
+
+def group_context(group, bridge):
+ # @@@ use bridge
+ return {
+ "group": group,
+ }

0 comments on commit 3b9e7fc

Please sign in to comment.