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
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to