[Dev] Contact quandary

Jeffrey Harris jeffrey at skyhouseconsulting.com
Mon Mar 1 17:22:32 PST 2004

Hi Folks,

I've been trying to get Contacts created that can be deleted, and I'm 
having problems.

When I create a new Contact with homeSection or workSection set, things 
look fine.  But when I try to delete the new Contact, I run into 
trouble.  I filed bug 1351 for this, thinking it's a repository problem, 
but now that I've pulled my hair out a little more and looked at the 
schema more carefully, I wonder if there's a problem there.

If you look at
you'll see that homeSection and workSection don't have direct 
inverseAttributes.  They do have sections as a superAttribute, but I'm 
not sure this works.  Try this thought experiment:

Create a Contact contact.
Create a ContactSection section.
Set contact.homeSection=section.

At this point the bi-directional link between contact and section has 
contact.homeSection pointing to section.sectionOwner.  But 
section.sectionOwner is pointing at contact.sections, not back at 
contact.homeSection, and in fact attributes may not exist.

Is this a problem, or am I misunderstanding how bi-directional links work?

Interestingly, when I do this in python, the repository doesn't complain 
about creating or committing contact.homeSection, but it fails whenever 
I try to delete contact.  That seemed to me to be because of this 
bi-directional problem.

The remedy to this, I thought, would be to create homeSectionFor and 
workSectionFor in ContactSection, and change homeSection and workSection 
to have these attributes as their inverseAttributes.  That seemed to 
work, but delete still doesn't quite work, so I don't know what's going on.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.osafoundation.org/pipermail/dev/attachments/20040301/4f0c8b5d/signature.bin

More information about the Dev mailing list