[ZPatterns] Deleting a DataSkin propertysheet?

Jean Jordaan jean@upfrontsystems.co.za
Thu, 27 Sep 2001 15:24:55 +0200


Hi Philip 

> AFAIK, you can't delete a propertysheet which is defined in the
> ZClass, 

Thanks for the answer! It helps. However, it shows I wasn't asking the
right question. 

Here is the problem I was trying to solve. On the live, remote site, the
CommonProperties propertysheet sometimes vanishes (see below). This is
what one user looks like remotely::

    FekoUser at /acl_users/iptheron@emss.co.za/propertysheets
    
    RestrictedProperties ()
    SystemProperties ()
    UserProfile ()
    webdav (DAV:)

To investigate, I exported the remote UserSource, and imported it
locally. (In order to import it, I had to upgrade ZPatterns, which
triggered the '_v_parent' issue I posted about seperately.) To my
surprise, the imported users *do* have CommonProperties, *with* the
correct values::

    FekoUser at /feko_usa/acl_users/iptheron@emss.co.za/propertysheets
    
    CommonProperties ()
    RestrictedProperties ()
    SystemProperties ()
    UserProfile ()
    webdav (DAV:)

So where are the remote CommonProperties hiding? This is the Python
Script code which adds these users::

    user = acl_users.UserSource.addUser( user_id
                                       , password
                                       , ['Anonymous'] # roles
                                       , [] 
                                       )

    user_common_ps      = user.propertysheets.CommonProperties
    user_userprofile_ps = user.propertysheets.UserProfile

    user_common_ps.manage_changeProperties(email=REQUEST['Email'])
    user_userprofile_ps.manage_changeProperties(
        REQUEST
      , ApplicationDate=application_date
      , URLCookie=URLCookie) 

I mentioned that CommonProperties seems to vanish *sometimes*. The first
time I looked for all the amputated users, I found 48 instances. I just
tried again, and this time there are only 37. The next time I ran it,
47. When I look at the user missing from the latest list, he does have
CommonProperties, with its values. I didn't look at individual users
after the check that reported 37. Here is the Python Script I use to
test::

    users = container.getMembers()
    missing_common = []

    for user in users:
    if getattr( user.propertysheets
              , 'CommonProperties'
              , None
              ) == None:
        missing_common.append(user.id)

    return missing_common

What else should I be trying? At the moment, I'm stumped. 

I should mention that we're using LoginManager with a modified version
of Bill Anderson's Membership implementation.

Regards,
Jean Jordaan