kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'kaedroho-get_context-args-kwargs'
commit
ef16c7a943
|
@ -394,23 +394,23 @@ class Page(MP_Node, ClusterableModel, Indexed):
|
|||
|
||||
return revision.as_page_object()
|
||||
|
||||
def get_context(self, request):
|
||||
def get_context(self, request, *args, **kwargs):
|
||||
return {
|
||||
'self': self,
|
||||
'request': request,
|
||||
}
|
||||
|
||||
def get_template(self, request):
|
||||
def get_template(self, request, *args, **kwargs):
|
||||
if request.is_ajax():
|
||||
return self.ajax_template or self.template
|
||||
else:
|
||||
return self.template
|
||||
|
||||
def serve(self, request):
|
||||
def serve(self, request, *args, **kwargs):
|
||||
return TemplateResponse(
|
||||
request,
|
||||
self.get_template(request),
|
||||
self.get_context(request)
|
||||
self.get_template(request, *args, **kwargs),
|
||||
self.get_context(request, *args, **kwargs)
|
||||
)
|
||||
|
||||
def is_navigable(self):
|
||||
|
|
Ładowanie…
Reference in New Issue