[Zope] LoginManager with SQL and Skinscript: adding properties to propertysheet propertysheet

Dan L. Pierson dan@sol.control.com
08 Jan 2001 11:43:33 -0500


Aaron Payne <aaron@aaronpayne.com> writes:

> I am following Dan Pierson's How-To SQL LoginManager with SQL and
> Skinscript. I am not able to add properties.

You may have noticed my silence on property sheets...  At first, I
didn't expect to use them, because I expected only members to edit
their "properties" and I'm certainly not going to expose the standard
Zope management interface to them.  After going through the latest PTK
sources some more, it looks like I may try using them after all.  In
either case, the important things to remember are:

- The actual property data isn't stored in the ZClass or its property
sheets, and the Skinscript code makes the ZClass "property" attributes
have values with or without property sheets, and

- The ZClass instances are ephemeral -- nothing is expected to store
them for any length of time (though they may be cached).

> I created LoginManager:LoginUser subclassed zclass def for a user with
> a propertysheet Basic.
> 
> It had properties password and email.  The LM methods I tested failed
> so I deleted the properties.  Now I want to add them again. When I try
> I get:
> 
> 
> for password
> Invalid property id, password. It is in use.
> for email:
> Invalid property id, email. It is in use.
> 
> I also deleted the entire propertysheet and tried to add the props but
> the same error occured.
> 
> 
> I can add new props but not ones that were deleted earlier. Is there a
> way around this problem?

I think you'll have to delete the whole ZClass and start over :-(.
This shouldn't be too much of a pain because you shouldn't have any
instances to worry about.  If you've written custom methods, you'll
want to copy them someplace before deleting the class.

Hope this helps,

Dan Pierson