[Zope3-Users] Prevent Duplicate Persistency

Dax fingermark at gmail.com
Tue Mar 14 22:59:57 EST 2006


For the following example (taken from "Zope3 In 30 Minutes"):

class IMark(Interface):
    """This is the book mark object."""

    url = TextLine(
        title=u"URL/Link",
        description=u"URL of the website",
        default=u"http://www.zope.org",
        required=True)

    description = Text(
        title=u"Description",
        description=u"Description of the website",
        default=u"",
        required=False)

How can I prevent Mark objects from having the same url?  So if a Mark
object exists in BookMarker with Mark.url="http://www.zope.org/", how
can I prevent another Mark object from being added when its url is
"http://www.zope.org"?

Thanks.


More information about the Zope3-users mailing list