Adrian Holovaty wrote:
> On 1/29/06, Pasi Savolainen <[EMAIL PROTECTED]> wrote:
> 
>>class Foo (meta.Model):
>>     name = meta.CharField (maxlength=100):
>>     def __repr__(self):
>>         return name;
>>- -
>>
>>note missing 'self.' from __repr__.
>>
>>The surprising result was that I got a _plaintext_ backtrace, not the
>>pwetty one :)
>>
>>Is it a bug or intended behaviour? (backtrace was pretty much useless)
> 
> 
> Hmm, I'd consider that a bug in the pretty error-page. How'd you
> invoke the __repr__() -- in a template, or in view code?
> 
> Adrian
> 

The __repr__ can get invoked by the local variable display in the error
page. The exception is propagated by the template debug stuff if that is
active, but as its already doing an error page, it will do the plain
backtrace. Probably the best thing here is to turn off template debug
for rendering the error page...

Reply via email to