I have never done it with the addform approach but it is very easily done with formlib.
form_fields = form.Fields(IMyContent)
def __init__(self, context, request):
self.context = context
self.request = request
def create(self, data):
mycontent = MyContent()
mycontent.title = data['title']
mycontent.user = self.request.principal.id
Register it as a page in your config file
On Tue, 20 Jun 2006 22:42:18 +0100 (BST), John Smith wrote
> I am trying to add some request related data into a content object (eg authenticated user etc).
> The content is being added using a normal addform/content_factory zcml approach.
> The class __init__ method does not receive any arguments, and the context/request pair are only available inside of views.
> So I am stumped.
> How do I get at the request object? A utility? An adaptor?
Try the all-new Yahoo! Mail . "The New Version is radically easier to use" The Wall Street Journal
_______________________________________________ Zope3-users mailing list Zope3firstname.lastname@example.org http://mail.zope.org/mailman/listinfo/zope3-users