## Script (Python) "atgb_add_entry" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind state=state ##bind subpath=traverse_subpath ##parameters=guest_name='',comment ##title=Add Guestbook Entry from Products.PythonScripts.standard import url_quote_plus req = context.REQUEST #context.addGuestbookEntry(guest_name, comment) entry_id=context.generateUniqueId('ATGBEntry') new_id = context.invokeFactory(id=entry_id, type_name='ATGBEntry') if new_id is None or new_id == '': new_id = entry_id entry=getattr(context, new_id, None) if entry is not None: entry.setGuest_name(guest_name) entry.setComment(comment) target = '%s/%s' % (context.absolute_url(),context.getTypeInfo().getActionById('view')) return req.RESPONSE.redirect(target)