<div dir="ltr">Hello, <br><br>I am new to plone/zope. I am trying to use z3c forms with plone to fetch some data from RDBMS but I am having an issue with variables passed to edit forms using GET and POST variables.<br><br>
>From what I read, the edit form needs to override the getContent function:<br><br>def getContent(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #get the id from the request object<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;personid = int(<b>self.request[&#39;entityid&#39;]</b>)<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  #use the id to look up the person<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;person = sql.getPerson(personid)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #create a return a dictionary<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; content = dict(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ (name, getattr(person,name))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for name in self.fields.keys()]) <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return content<br><br>This works and I can display values just fine, but when I do something similar in the action handler<br><br> @button.buttonAndHandler(u&#39;Apply&#39;,name=&#39;applyView&#39;)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;def handleApplyView(self,action):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.handleApply(self,action)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not self.widgets.errors:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url = absoluteURL(self.context,self.request)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url += &#39;/person-view?id=&#39; + <b>self.request[&#39;entityid&#39;]</b><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.request.response.redirect(url)<br><br><br>I get an error that there is no entityid key in self.request. &nbsp;Inspecting the request object seems to confirm that. <br>I guess my other options are to:<br>
<br>- Get the value from form directly with <b>self.request.form.widgets.entityid</b> (seems like an ugly thing to do)<br>- Get the value from <b>data[]</b> dictionary.<br><br>What would be the best pattern for handling this type of processing?<br>
<br>I have used z3c.formdemo and their example (sqlmessage) but for some reason self.request[&#39;id&#39;] seems to work for them. &nbsp;<br><br>Thanks for your time<br><br>Daniel Fimiarz<br></div>