def get_form_template(self, request, template=None, context=None): """ :Returns: Rendered form template with the given context, if any. """ if not context: context = RequestContext(request) with update_context(context, {'form': self.get_form(request, prefix=self.get_form_prefix())}): return render_to_string(template or self.edit_templates, context)
def render(self, context, template=None): """ A ``template`` kwarg can be passed to use an explictly defined template instead of the default template list. """ with update_context(context, {'self': self}): return render_to_string( template or self.get_render_templates(context), context)
def render(self, context, template=None): """ A ``template`` kwarg can be passed to use an explictly defined template instead of the default template list. """ with update_context(context, {'self': self}): return render_to_string( template or self.get_render_templates(context), context )
def get_form_template(self, request, template=None, context=None): """ :Returns: Rendered form template with the given context, if any. """ if not context: context = RequestContext(request) with update_context( context, {'form': self.get_form(request, prefix=self.get_form_prefix())}): return render_to_string(template or self.edit_templates, context)
def get_preview_template(self, site): """ :Returns: Rendered preview template. """ return render_to_string(self.preview_templates, { 'self': self, 'edit_url': site.reverse(site.node_edit_view, kwargs={ 'node_pk': self.node.pk, }), 'site': site, })
def get_preview_template(self, site): """ :Returns: Rendered preview template. """ return render_to_string( self.preview_templates, { 'self': self, 'edit_url': site.reverse(site.node_edit_view, kwargs={ 'node_pk': self.node.pk, }), 'site': site, })