[ZODB-Dev] RFC: Attributes and Options for IndexedCatalog

Mike C. Fletcher mcfletch@rogers.com
Tue, 28 Jan 2003 15:35:54 -0500


I'd suggest a "d" option:

    d. Use properties with the property objects storing the meta-data 
about the property/attribute.

That limits you to ZODB4, but it does make for very clean operation and 
interface.  Since you're requiring that the objects be 
IndexedCatalog-aware, using properties doesn't seem that onerous (to me 
;) ) comparatively.

For normal operation:

    catalog = Catalog( myClass, myClass.startDate, myClass.stopDate, 
myClass.name )

where the .'d names are getting pointers to the property objects from 
the class.  You can create pseudo-properties (objects with the same 
interface, but which aren't actually stored in the class) in cases where 
you don't actually want to modify the class by introducing properties.

    catalog = Catalog( (myClass,myOtherClass), PropertyLike('name') )

ZODB4 only-ness is likely to kill the idea, but I can dream :) ,
Mike

Christian Reis wrote:
...

>What we need is a flexible, yet clean way of specifying class attributes
>and controlling options for each of them.
>
>2. Class attributes
>
>  
>
...

>    c. We could kick the bucket and go for specifying a schema
>    externally to the class, perhaps using XML. The drawbacks here are
>    that information ends up being split up between the schema file and
>    the domain object, it's very un-Pythonic, and complicates further
>    migrating from a non-IC applications.
>
>    Johan says something about "generating domain class code from XML"
>    next to me and I feel worried.
>  
>
...

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/