[Zope] overload __getattr__ in brains-class?

Jo Meder jo@meder.de
Mon, 22 Jul 2002 22:28:41 +0200


Am 22.07.2002, 19:13 Uhr
	schrub Dan L. Pierson <dan@control.com>:

 
> If what you want to do is add a small fixed number of other attributes
> to the result of a ZSQL query (sorry, I missed your initial question),
> Jim Fulton gave me the simplest solution at the last IPC:  just return
> the additional attributes as null values

This might really work, but it I'm afraid it won't get me where I want
to go. The idea behind all this is to create a common base class for my
content-objects (in CMF) which are stored in mySQL-tables. 

I'm trying to separate the CMF/Zope-specific data (mostly DublinCore, owner,
workflow and permissions) from the "real" content. That way I could keep
the table definitions clean and wouldn't have to bloat each table with
all the attributes Zope needs in addition to the content. All the
metadata would be stored in one table for all derived classes (keyed by
tablename and recordid of the content object).

So my common base class would be there to handle all the zopish stuff
and derived classes would be concentrating on the specifics of the data
at hand.

I knew I was inviting trouble when I started to think about storing
Zope content in a RDBMS but I'd never have imagined the toughest problem
would be the limitations of the Record object implementation.

	Jo.


-- 
Internetmanufaktur Jo Meder ---------------------- Berlin, Germany
http://www.meder.de/ ------------------- fon: ++49-30-417 17 63 33
Kollwitzstr. 75 ------------------------ fax: ++49-30-417 17 63 45
10435 Berlin --------------------------- mob: ++49-170- 2 98 89 97
Public GnuPG-Key ---------- http://www.meder.de/keys/jo-pubkey.txt