I have the following form :
<form action="/auction/create/" method="post">< p><label
for="auction_cr eated">Created</label><br /></p>
<p><label for="auction_us er">User</label><br /><input id="auction_use r"
name="auction[user]" size="30" type="text" value="" /></p>
<p><label for="auction_au ction_title">Au ction title</label><br /><input
id="auction_auc tion_title" name="auction[auction_title]" size="30"
type="text" value="" /></p>
<p><label for="auction_au ction_url">Auct ion url</label><br /><input
id="auction_auc tion_url" name="auction[auction_url]" size="30" type="text"
value="" /></p>
<p><label for="auction_mo dification_rec" >Modification rec</label><br
/><input id="auction_mod ification_rec" name="auction[modification_re c]"
size="30" type="text" value="" /></p>
<p><label for="auction_st ate">State</label><br /><input id="auction_sta te"
name="auction[state]" size="30" type="text" value="" /></p><input
name="commit" type="submit" value="Create" /></form>
I post the form data with the following calls:
params = urllib.urlencod e({"auction[user]" :user,
"auction[auction_title]": auction_title," auction[auction_url]": auction_url,
"auction[modification_re c]" :recommendation , "auction[state]=":
state,"commit": "Create"})
print "Storing... ."
data = urllib.urlopen( self.baseUrl,pa rams)
When I go and view the inserted record, the record exists, but the field
values are null. It is my thinking that the backend needs the "id" value
for each input value; how do I add that data to the urlencode() call?
When I utilize the above form, all is inserted and all of the field values
appear. What data am I not accounting for with my program; for its obvious
that the browser is sending something to the server that my application is
not.
Thanks.
<form action="/auction/create/" method="post">< p><label
for="auction_cr eated">Created</label><br /></p>
<p><label for="auction_us er">User</label><br /><input id="auction_use r"
name="auction[user]" size="30" type="text" value="" /></p>
<p><label for="auction_au ction_title">Au ction title</label><br /><input
id="auction_auc tion_title" name="auction[auction_title]" size="30"
type="text" value="" /></p>
<p><label for="auction_au ction_url">Auct ion url</label><br /><input
id="auction_auc tion_url" name="auction[auction_url]" size="30" type="text"
value="" /></p>
<p><label for="auction_mo dification_rec" >Modification rec</label><br
/><input id="auction_mod ification_rec" name="auction[modification_re c]"
size="30" type="text" value="" /></p>
<p><label for="auction_st ate">State</label><br /><input id="auction_sta te"
name="auction[state]" size="30" type="text" value="" /></p><input
name="commit" type="submit" value="Create" /></form>
I post the form data with the following calls:
params = urllib.urlencod e({"auction[user]" :user,
"auction[auction_title]": auction_title," auction[auction_url]": auction_url,
"auction[modification_re c]" :recommendation , "auction[state]=":
state,"commit": "Create"})
print "Storing... ."
data = urllib.urlopen( self.baseUrl,pa rams)
When I go and view the inserted record, the record exists, but the field
values are null. It is my thinking that the backend needs the "id" value
for each input value; how do I add that data to the urlencode() call?
When I utilize the above form, all is inserted and all of the field values
appear. What data am I not accounting for with my program; for its obvious
that the browser is sending something to the server that my application is
not.
Thanks.
Comment