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

2006-10-30 Thread Stephan Richter
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
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-09-28 Thread KLEIN Stéphane

Hi,

I would like add category feature to
http://codespeak.net/svn/z3/zblog/trunk/ code.

What is the best solution ? Add a category index with Catalog object ?
Create a new  ICategory interface and Category content ? How can I do
the link between zblog entry dans category object ?

Other information, I can put one blogentry in one or several category.

Thanks for your help
Stéphane
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users