Re: Form Rendering API Proposal

2011-07-08 Thread Gregor Müllegger
Hi Chris, 2011/6/29 Chris Beaven : >> >> I think thats conceptually not possible. We simply can change the widget >> during >> template rendering time, which makes it impossible to decide in the python >> code with which widget we end up. And theoretically we could even render >> the >> form twice

Re: Consistent exception handling in templates.

2011-07-08 Thread Jacob Kaplan-Moss
On Thu, Jul 7, 2011 at 8:37 PM, Tai Lee wrote: > The docs say that when writing custom template tags, the `render()` > function should never raise `TemplateSyntaxError`, [...] This rule is the correct one, and I'm very much against changing it. > [...] but some of Django's own template tags (e.g

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonathan Slenders
Something related I was wondering about... Errors in templates should be silenced -- I agree with that -- but only when they are caused by an error in the template. Variable.resolve can fail silent because that's caused by the template author, who is referring to non-existing variables. However,

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonas H.
On 07/08/2011 05:24 PM, Jonathan Slenders wrote: My feeling is that we should silence TypeError, AttributeError and KeyError in _resolve_lookup, but only when they occur one frame deep. I agree with what you propose but AFAIK it's not easy to solve without doing frame analysis (I'd say that fe

Re: Form Rendering API Proposal

2011-07-08 Thread Chris Beaven
On Saturday, July 9, 2011 12:19:44 AM UTC+12, Gregor Müllegger wrote: > > [...] So we decided to skip changing a widget totally in the form > rendering. > Displaying a form and anything else that happens in the template has a > representational purpose, so we saw it would be out of scope for the

Re: Form Rendering API Proposal

2011-07-08 Thread Carl Meyer
Hi Chris, On 07/08/2011 04:00 PM, Chris Beaven wrote: > On Saturday, July 9, 2011 12:19:44 AM UTC+12, Gregor Müllegger wrote: > [...] So we decided to skip changing a widget totally in the form > rendering. > Displaying a form and anything else that happens in the template has a >

Re: Consistent exception handling in templates.

2011-07-08 Thread Tai Lee
On Jul 8, 11:31 pm, Jacob Kaplan-Moss wrote: > > [...] but some of Django's own template tags (e.g. `widthratio`) don't > > adhere to > > this policy. > > These are bugs, and should be fixed. Thanks for this clarification. I will try to review the built-in tags and submit some patches to fix t

Re: Consistent exception handling in templates.

2011-07-08 Thread Karen Tracey
On Fri, Jul 8, 2011 at 9:55 PM, Tai Lee wrote: > Secondly, there is the inconsistent behaviour between production and > development environments related to the `TEMPLATE_DEBUG` setting. I > think that if an exception is intentionally silenced in production, it > should also be intentionally silen

Re: Consistent exception handling in templates.

2011-07-08 Thread Tai Lee
On Jul 9, 12:24 pm, Karen Tracey wrote: > I'm strongly against that idea. Swallowing errors makes it incredibly > difficult to debug errors. I would prefer for the `TEMPLATE_DEBUG` setting to > turn off much of the error-silencing currently done in template processing. > Yes, that means differen