[Zope3-dev] Problem with content object attributes and DublinCore

Nicholas Wieland nicholas_wieland at yahoo.it
Thu Oct 28 05:45:35 EDT 2004


Hi again, I have a problem with a content object, when I try to add it
it returns a system error.

#category.py
class Category (Folder):

  implements (ICategory, ISiteContained, IProductContainer, ILocation)

  def setTitle (self, title):
    dc = IZopeDublinCore (self)
    dc.title = title

  def getTitle (self):
    dc = IZopeDublinCore (self
    return dc.title

  title = property (setTitle, getTitle)

#browser/configure.zcml
<addform
  label="Add Category"
  name="addCategory.html"
  schema=".interfaces.IProductCategory"
  content_factory=".product_category.Category"
  fields="title"
  permission="zope.ManageContent"
  />

The error is

  File "/usr/home/nicholas/Zope/src/zope/schema/_bootstrapfields.py",
line 180, in set
    setattr(object, self.__name__, value)
TypeError: getTitle() takes exactly 1 argument (2 given)

If I don't use DC but a normal title = u'' it works as expected.
I'm unable to track the problem.

TIA,
  ngw



More information about the Zope3-dev mailing list