Esempio n. 1
0
 def render(self, context):
     try:
         from django_inlines.inlines import registry
         
         if self.template_directory is None:
             rendered = registry.process(self.var_name.resolve(context))
         else:
             rendered = registry.process(self.var_name.resolve(context), template_dir=self.template_directory)
         if self.asvar:
             context[self.asvar] = rendered
             return ''
         else:
             return rendered
     except:
         return ''
Esempio n. 2
0
    def render(self, context):
        try:
            from django_inlines.inlines import registry

            if self.template_directory is None:
                rendered = registry.process(self.var_name.resolve(context), context=context)
            else:
                rendered = registry.process(self.var_name.resolve(context), context=context, template_dir=self.template_directory)
            if self.asvar:
                context[self.asvar] = rendered
                return ''
            else:
                return rendered
        except:
            if getattr(settings, 'INLINE_DEBUG', False): # Should use settings.TEMPLATE_DEBUG?
                raise
            return ''
Esempio n. 3
0
    def render(self, context):
        try:
            from django_inlines.inlines import registry

            if self.template_directory is None:
                rendered = registry.process(self.var_name.resolve(context))
            else:
                rendered = registry.process(
                    self.var_name.resolve(context),
                    template_dir=self.template_directory)
            if self.asvar:
                context[self.asvar] = rendered
                return ''
            else:
                return rendered
        except:
            return ''
Esempio n. 4
0
    def render(self, context):
        try:
            from django_inlines.inlines import registry

            if self.template_directory is None:
                rendered = registry.process(self.var_name.resolve(context),
                                            context=context)
            else:
                rendered = registry.process(
                    self.var_name.resolve(context),
                    context=context,
                    template_dir=self.template_directory)
            if self.asvar:
                context[self.asvar] = rendered
                return ''
            else:
                return rendered
        except:
            if getattr(settings, 'INLINE_DEBUG',
                       False):  # Should use settings.TEMPLATE_DEBUG?
                raise
            return ''