On Apr 11, 4:49 pm, "Rajeev J Sebastian" <[EMAIL PROTECTED]>
wrote:
> On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote:
>
> > def render(self, context):
> > "Display stage -- can be called many times"
> > if not isinstance(context, Context):
> > context =
On Fri, Apr 11, 2008 at 12:02 PM, Patryk Zawadzki <[EMAIL PROTECTED]> wrote:
> Why not use the opposite test and check for instances of dict?
Because then you have to pass something that subclasses dict instead
of something that implements the interface of dict. We could go on and
on about this
On Fri, Apr 11, 2008 at 5:49 PM, Rajeev J Sebastian
<[EMAIL PROTECTED]> wrote:
> On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote:
> >
> > def render(self, context):
> > "Display stage -- can be called many times"
> > if not isinstance(context, Context):
> >
On Fri, Apr 11, 2008 at 8:56 PM, Simon Willison <[EMAIL PROTECTED]> wrote:
>
> def render(self, context):
> "Display stage -- can be called many times"
> if not isinstance(context, Context):
> context = Context(context)
> return self.nodelist.render(context)
>
> This is backw
Here's something that has been quietly bugging me about Django for /
years/:
Context() is an implementation detail of the template engine. Having
to instantiate a Context just to pass it to render() is unnecessary
boilerplate (and means you have to import another symbol as well).
Template.render