django - Class based views: get_context_data method -
i know it's purpose is, , know how use it. i'm curious, code doing , why written way i?
i'm referring this:
def get_context_data(self, **kwargs): context = super(createlisting, self).get_context_data(**kwargs) context['action'] = reverse('create-listing') return context
so i'm creating dict called context django base controller class manipulating on end? or off? super part throws me off because i'm not sure relevant information i'm getting it.
the super call getting context whatever createlisting
s super class is. it's can subclass view , add more context in each of subclasses - in instance you're adding action
context.
Comments
Post a Comment