On Wed, May 14, 2008 at 10:07 AM, Simon Willison <[EMAIL PROTECTED]> wrote: >> I suspect that a lot of people actually rely on this behavior, and it >> would be devastating to them. > > Thinking about it some more you're right - I'm sure there are lots of > cases where people are relying on things like the following: > > {{ article.something.title }} - outputs text if article is there, > fails silently otherwise
I'm not expert on the history of this or anything, but I always thought this example was the basis for silent errors. That makes me wonder, then, if there's some other kind of separation we can have. Perhaps variable lookups continue to fail silently, regardless of environment, while actual {% ... %} tags raise errors by default. Of course, there's still something to be said for using DEBUG to show errors in development, while not in production, and individual tags would obviously be able to suppress their own errors if they choose to, but I think it might work. And at the risk of supplying too many possibilities for one email, the magic_quotes problem could be avoided similarly to autoescaping. Essentially, provide an extra argument to all the template rendering functions, with a default based on the DEBUG (or other) setting. Something like def render(self, context, silent_errors=not settings.DEBUG). Then, individual apps can specify their behavior explicitly if they need to, while relying on the setting if they don't. I'm probably way off-base on these ideas, though, because it would likely lead to a lot of "hey, why is this template erroring out, while this other one isn't?" I dunno. This email was probably too stream-of-consciousness to be of any use. But there it is. -Gul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---