<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hey guys, please help me! I'm using Grok 1.4, z3c.form 2.4.2 and need a field to hold an uploaded file. I would like to have something as close as possible to plone.formwidget.namedfile. Whether I depend on z3c.namedfile, zope.app.file or zope.file the result is ultimately the same: complains about dependencies that goes down to the point where I can't go further, i.e, <br><br>&nbsp;&nbsp;&nbsp; ConfigurationError: ('Invalid value for', 'menu', "ImportError: Couldn't import zmi_actions, No module named zmi_actions")<br><br>The (simplified) code is as follows:<br><br>from zope.interface import Interface<br>from zope import schema<br>import grok<br>from zope.schema.fieldproperty import FieldProperty<br>from megrok.z3cform.base import PageAddForm, Fields<br><br><br>class
 IDocMaster(Interface):<br>&nbsp;&nbsp;&nbsp; title = schema.Text(title=u"The title")<br>&nbsp;&nbsp;&nbsp; template = schema.Bytes(title=u"The template")<br><br>class DocMaster(grok.Model):<br>&nbsp;&nbsp;&nbsp; grok.implements(IDocMaster)<br><br>&nbsp;&nbsp;&nbsp; title = FieldProperty(IDocMaster["title"])<br>&nbsp;&nbsp;&nbsp; template= FieldProperty(IDocMaster["template"])<br><br>&nbsp;&nbsp;&nbsp; def __init__(self, title, template):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.title = title<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.template = template<br><br>class DocAdd(PageAddForm):<br>&nbsp;&nbsp;&nbsp; grok.context(Interface) #actually a specialised container<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; fields = Fields(IDocMaster)<br>&nbsp;&nbsp;&nbsp; label = "New doc"<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def createAndAdd(self, data):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doc =
 DocMaster(**data)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id = str(doc.title) #if you use a single word as title this will do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.context[id] = doc<br><br>In setup.py,<br><br>install_requires=[<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'setuptools',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # -*- Extra requirements: -*-<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.browserresource',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.app.pagetemplate',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'z3c.form',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'megrok.z3cform.base',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'megrok.z3cform.ui',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'megrok.z3cform.layout',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 'zope.app.schema',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zc.sourcefactory',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'relatorio',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">#IF I INCLUDE THESE THE ABOVE MENTIONED ERROR OCCURS</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.browsermenu',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.app.container',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.file',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zope.mimetype',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br></div>



</div></body></html>