[Zope-dev] ZPatterns and SQL

Phillip J. Eby pje@telecommunity.com
Mon, 19 Feb 2001 11:44:25 -0500


At 05:29 PM 2/19/01 +0100, Christian Scholz wrote:
>> 
>> You need to use an attribute which the object has *if and only if* it
>> exists in the database.  If the class has the attribute defined, all
>> instances exist, and you can't even load it with SkinScript because
>> ZPatterns uses __getattr__ to redefine attributes, and that doesn't work if
>> the attribute already exists in the class.
>
>So I shouldn't define it inside the ZClass propertysheet? 
>Do I understand this right?
>(I remember having problems when using properties not defined in a
>sheet somewhere.. or am I mistaken completely somehow? ;-)

You can't do this with a load attribute, because a default value will
exist.  The easiest way to deal with this is simply to have a seperate
attribute name just for loading, or use an attribute that isn't on a
property sheet.