Skip to content

Instantly share code, notes, and snippets.

View vdboor's full-sized avatar

Diederik van der Boor vdboor

View GitHub Profile
@vdboor
vdboor / mixins.py
Created October 31, 2012 08:52
Django view initialization ordering issues
class BaseViewMixin(object):
def dispatch(self, request, *args, **kwargs):
# Set earlier to let get_loggedin_user() and get_context_user() work.
# They run before the get() and post() methods are called.
self.request = request
self.args = args
self.kwargs = kwargs
# Run checks before entering the view.
@vdboor
vdboor / dashboard.py
Created July 28, 2011 21:17
Example dashboard module
class PersonalModule(modules.LinkList):
title = _('Welcome,')
draggable = False
deletable = False
collapsible = False
template = 'ecms_dashboard/modules/personal.html'
def init_with_context(self, context):
super(PersonalModule, self).init_with_context(context)