We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8464dc2 commit ce88380Copy full SHA for ce88380
css-grid/views.py
@@ -0,0 +1,21 @@
1
+"""
2
+CSS Grid Template
3
4
+
5
+class CSSGridMixin(object):
6
+ """
7
+ A mixin for adding css grid to any standard CBV
8
9
10
+ def get_context_data(self, **kwargs):
11
12
+ Insert the single object into the context dict.
13
14
+ context = {}
15
+ if self.object:
16
+ context['object'] = self.object
17
+ context_object_name = self.get_context_object_name(self.object)
18
+ if context_object_name:
19
+ context[context_object_name] = self.object
20
+ context.update(kwargs)
21
+ return super(SingleObjectMixin, self).get_context_data(**context)
0 commit comments