Overriding builtin getattr method



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 &lt; &gt; 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

.



Relevant Pages

  • Re: Tables - Cells - Preview Mode
    ... That is where a database driven web site comes into play, ... Thomas A. Rowe (Microsoft MVP - FrontPage) ... > peices when previewed anywhere....in the browser or in ... distributing cells around and ect. ...
    (microsoft.public.frontpage.client)
  • Re: Overriding builtin getattr method
    ... I have data stored in the database which has special characters ... Whenever I wanted to present the output to a browser ... If you have to build an HTML page, escape those characters at *that* stage. ...
    (comp.lang.python)
  • Re: Replication problems
    ... An error occurred while accessing the DHCP database. ... DHCP server event log for more information on this error. ... browser for the domain on transport NetBT_Tcpip_{99B638B5-2C0B. ... master browser is stopping or an election is being forced. ...
    (microsoft.public.windows.server.active_directory)
  • Re: FP/DOS 2.6 -> vfp9 report conversion
    ... resulting application will run in a standard browser ... I hope that's for single-user applications. ... access with that of the database system. ...
    (comp.databases.pick)
  • Re: PMJ The REALLY final card list (nearly!)
    ... The url in each link includes a big lump of the database. ... I've had a look back through the server Logs & the File is being ... Maybe it's a Cache prob? ... Sometimes the Browser is getting the File Served up incorrectly. ...
    (uk.people.silversurfers)