Hi,

I have implemented a view for a catalog index. The page template contains this little form to add strings to a list of categories:


<form action="@@add_category" method="post">
    <input type="text" name="name">
    <input type="submit">               
</form>

The view class looks like this:

class EditView(object):
    def categories(self):
        return self.context.categories

    def add_category(self,name):
        self.context.categories.append(name)

Together they are registered as:

    <browser:page
        name="categories.html"
        title="Categories"
        menu="zmi_views"
        permission="zope.ManageServices"
        for="proCoders.interfaces.ICategoryIndex"
        class=".CategoryIndex.EditView"
        template="CategoryIndex.pt"
        />
        
    <browser:page
        for="proCoders.interfaces.ICategoryIndex"
        name="add_category"
        class=".CategoryIndex.EditView"
        attribute="add_category"
        permission="zope.ManageServices"/>

If I submit the form, add_category is called, but I get the following error:

ForbiddenAttribute: ('append', [])

Any hint what I'm doing wrong?

regards,
Achim
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to