[Zope3-Users] How can I "link" two object. Exemple how link blogentry and category.

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Oct 30 10:05:38 EST 2006


On Thursday 28 September 2006 13:40, KLEIN Stéphane wrote:
> What is the best solution?

> Add a category index with Catalog object ? 

That is only needed for optimizations.

> Create a new  ICategory interface and Category content?

Yes.

> How can I do the link between zblog entry dans category object ?

Simply make it a Python reference:

class BlogEntry(object):
  category = None

class Category(object):
  pass

entry = BlogEntry()
entry.category = Category()

Of course, you need to get permissions and interfaces correctly. You might 
also want to investigate annotations. The following add-on packages are also 
relevant:

http://svn.zope.org/lovely.tag/
http://svn.zope.org/lovely.rating/


You could then build a category implementation on top of tags. We have done 
this for a large site and it works well.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list