[Zope3-Users] Error when calling addform

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Feb 18 14:42:39 EST 2007


On Sunday 18 February 2007 12:06, Florian Lindner wrote:
>     def create(self, data):
>         comment = BlogComment()
>         comment.name = data["name"]
>         comment.email = data["email"]
>         comment.content = data["content"]
>         return comment
>
> If I just omit create is complains that the function must be implemented.
> Can this be done easier?

for name, value in data.items():
    setattr(comment, name, value)

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