Re: backrefs using ref name / annotations?

whit <whit-UE+B0n23d/[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel,gmane.comp.web.zope.plone.archetypes.general
Message-ID <[email protected]>
gmane wrote:
> Hello,
> 
> (crossposting - hopefully not inappropriately)
> 
> I need automatic back references (just two-way references, really), but 
> would like to find a way to have them using stock AT ref fields & 
> widgets (I have taken a look at ATBackRef product).
> 
> I thought of a mechanism hooked somewhere that would (ab)use 
> ReferenceField "relationship" property: upon reference creation, the 
> mechanism would see if the target has a ReferenceField whose 
> relationship attribute has the same value as the source relationship, 
> and then automatically add another reference, ie. from the target to the 
> source. Are there any places where this kind of hooks can be registered 
> btw?
> 
> I don't know if using relationships this way confuses the reference 
> system somehow - what are the consequences? I read something about 
> reference annotations - could they be used for this purpose somehow?
> 
> I guess there's an easy way, too - just add a field property 
> "[relationshipname]_inverese" in the field that is to be used as the 
> back reference?
> 
> Overall, perhaps this kind of automatic backref mechanism using stock AT 
> fields & widgets would be useful enough to be added to Archetypes?
> 
> Thoughts?
> 
> Thanks,
> 
>  Petri
> 

references are inherently 2 way, they just happen to be stored on the 
source.  for most cases, having a special field or class is overkill.

fyi, there is already an api for backrefs.

-w



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.