Overriding builtin getattr method
- From: "Raja Raman Sundararajan" <ram0812@xxxxxxxxxxx>
- Date: 3 Oct 2006 01:24:22 -0700
Hello guys,
I have data stored in the database which has special characters
like <, > etc.
Case 1: Whenever I wanted to present the output to a browser
I need to escape these special characters into the browser
equivalent like < > etc.( for example by using the cgi module)
Case 2: Whenever I wanted to present the output to some client other
than a browser, I wanted to present the data as it is stored in the
database.
For doing this I thought of overriding the __builtin__.__getattr__
method.
I am wondering if there is any other way of achieving this. I have
loads of files that get the attribute values of objects stored in the
database and I do not want to manually change the way of DB access in
those files. I rather prefer a centralized way to achieve this.
Good inputs are always appreciated.
:-)
Raja
.
- Follow-Ups:
- Re: Overriding builtin getattr method
- From: Gabriel Genellina
- Re: Overriding builtin getattr method
- From: Raja Raman Sundararajan
- Re: Overriding builtin getattr method
- Prev by Date: Re: app with standalone gui and web interface
- Next by Date: Re: Overriding builtin getattr method
- Previous by thread: Python to use a non open source bug tracker?
- Next by thread: Re: Overriding builtin getattr method
- Index(es):
Relevant Pages
|