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 createlistings super class is. it's can subclass view , add more context in each of subclasses - in instance you're adding action context.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -