Currently we have a page where users can fill in a table. This table has a variable lenght because rows are added dynamically. We want to get all the content of the table and put it in a list, so we send it to our database.
The biggest problem is that we don't know how to send the data to a list and get it to our vieuw. can some1 help me with this problem? thanks in advance.
Can you be a bit more specific with what you are attempting to do? Have you
created a form with input fields throughout this table? Are you posting the
form data to your pyramid application?
On Wed, Mar 13, 2013 at 8:42 AM, Gert V <gert.verstrae...@gmail.com> wrote:
> We use pyramid and chameleon template.
> Currently we have a page where users can fill in a table.
> This table has a variable lenght because rows are added dynamically.
> We want to get all the content of the table and put it in a list, so we
> send it to our database.
> The biggest problem is that we don't know how to send the data to a list
> and get it to our vieuw.
> can some1 help me with this problem?
> thanks in advance.
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscribe@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
-- Vincent Catalano
Software Engineer and Web Ninja,
(520).603.8944
Thanks for the fast reply. sorry i wasn't clearer on my previous post. If annything is still not documentated enough please let me know. i'll give some code snippets of my template. no data is loaded into this page. the user has to fill in a few fields and after that we want to store it to our database.
every time the user has filled in the dz_code textfield, annother textfield will appear beneeth it. (using javascript) I'd like to get all the data of this table into a list. each row is a medical file of a patient and should be placed in a table "medical files". To bring it to our database I understood I need to bring this list to a view in our views.py so we can send it to the database.
On Wednesday, March 13, 2013 5:28:29 PM UTC+1, Vincent Catalano wrote:
> Can you be a bit more specific with what you are attempting to do? Have > you created a form with input fields throughout this table? Are you posting > the form data to your pyramid application?
> -Vincent
> On Wed, Mar 13, 2013 at 8:42 AM, Gert V <gert.ver...@gmail.com<javascript:> > > wrote:
>> We use pyramid and chameleon template.
>> Currently we have a page where users can fill in a table. >> This table has a variable lenght because rows are added dynamically. >> We want to get all the content of the table and put it in a list, so we >> send it to our database.
>> The biggest problem is that we don't know how to send the data to a list >> and get it to our vieuw. >> can some1 help me with this problem? >> thanks in advance.
>> -- >> You received this message because you are subscribed to the Google Groups >> "pylons-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to pylons-discus...@googlegroups.com <javascript:>. >> To post to this group, send email to pylons-...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out.
> -- > Vincent Catalano > Software Engineer and Web Ninja, > (520).603.8944
On Wed, Mar 13, 2013 at 11:43 AM, Gert V <gert.verstrae...@gmail.com> wrote:
> Thanks for the fast reply. sorry i wasn't clearer on my previous post. If
> annything is still not documentated enough please let me know.
> i'll give some code snippets of my template. no data is loaded into this
> page. the user has to fill in a few fields and after that we want to store
> it to our database.
> every time the user has filled in the dz_code textfield, annother
> textfield will appear beneeth it. (using javascript)
> I'd like to get all the data of this table into a list. each row is a
> medical file of a patient and should be placed in a table "medical files".
> To bring it to our database I understood I need to bring this list to a
> view in our views.py so we can send it to the database.
> On Wednesday, March 13, 2013 5:28:29 PM UTC+1, Vincent Catalano wrote:
>> Can you be a bit more specific with what you are attempting to do? Have
>> you created a form with input fields throughout this table? Are you posting
>> the form data to your pyramid application?
>> -Vincent
>> On Wed, Mar 13, 2013 at 8:42 AM, Gert V <gert.ver...@gmail.com> wrote:
>>> We use pyramid and chameleon template.
>>> Currently we have a page where users can fill in a table.
>>> This table has a variable lenght because rows are added dynamically.
>>> We want to get all the content of the table and put it in a list, so we
>>> send it to our database.
>>> The biggest problem is that we don't know how to send the data to a list
>>> and get it to our vieuw.
>>> can some1 help me with this problem?
>>> thanks in advance.
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "pylons-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to pylons-discus...@**googlegroups.com.
>>> To post to this group, send email to pylons-...@googlegroups.**com.
>> --
>> Vincent Catalano
>> Software Engineer and Web Ninja,
>> (520).603.8944
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscribe@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
-- Vincent Catalano
Software Engineer and Web Ninja,
(520).603.8944
What you could do is the following. Make on the client in javascript a datastructure (probably a list), that has all the relevant data from the table. Do a JSON.stringify() on a the data structure and send the resulting string to the webserver either using a hidden field in a form, either using an AJAX call. On the webserver it is very easy to decode the string back to the datastructure: in PHP use json_decode, in Node.js use JOSN.parse, in Python use json.loads ...
You can submit a form with multiple records(this's how checkbox works), because you data is come from a html table, not in input control, you need collect all your data in json(take a loook at jquery.ajax) and build a form submit you wanted, the pyramid side will decode the form submit normally, and you can access them in request.POST(remember it's a multidict, can hold multiple values per key).
> Thanks for the fast reply. sorry i wasn't clearer on my previous post. If > annything is still not documentated enough please let me know.
> i'll give some code snippets of my template. no data is loaded into this > page. the user has to fill in a few fields and after that we want to store > it to our database.
> every time the user has filled in the dz_code textfield, annother > textfield will appear beneeth it. (using javascript)
> I'd like to get all the data of this table into a list. each row is a > medical file of a patient and should be placed in a table "medical files".
> To bring it to our database I understood I need to bring this list to a > view in our views.py so we can send it to the database.
> On Wednesday, March 13, 2013 5:28:29 PM UTC+1, Vincent Catalano wrote:
>> Can you be a bit more specific with what you are attempting to do? Have >> you created a form with input fields throughout this table? Are you posting >> the form data to your pyramid application?
>> -Vincent
>> On Wed, Mar 13, 2013 at 8:42 AM, Gert V <gert.ver...@gmail.com> wrote:
>>> We use pyramid and chameleon template.
>>> Currently we have a page where users can fill in a table.
>>> This table has a variable lenght because rows are added dynamically.
>>> We want to get all the content of the table and put it in a list, so we >>> send it to our database.
>>> The biggest problem is that we don't know how to send the data to a list >>> and get it to our vieuw.
>>> can some1 help me with this problem?
>>> thanks in advance.
>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "pylons-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to pylons-discus...@googlegroups.com.
>>> To post to this group, send email to pylons-...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>> -- >> Vincent Catalano
>> Software Engineer and Web Ninja,
>> (520).603.8944
Now we'd like to send it to our view using AJAX so we can send it to our model/database. How can we do this, cause we can't seem to find the documentation for this.
On Wednesday, March 13, 2013 4:42:30 PM UTC+1, Gert V wrote:
> We use pyramid and chameleon template.
> Currently we have a page where users can fill in a table. > This table has a variable lenght because rows are added dynamically. > We want to get all the content of the table and put it in a list, so we > send it to our database.
> The biggest problem is that we don't know how to send the data to a list > and get it to our vieuw. > can some1 help me with this problem? > thanks in advance.
On Wednesday, March 13, 2013 4:42:30 PM UTC+1, Gert V wrote:
> We use pyramid and chameleon template.
> Currently we have a page where users can fill in a table. > This table has a variable lenght because rows are added dynamically. > We want to get all the content of the table and put it in a list, so we > send it to our database.
> The biggest problem is that we don't know how to send the data to a list > and get it to our vieuw. > can some1 help me with this problem? > thanks in advance.
> We managed to set up a ajax request with our data inside.
> We get the succes message, but we don't know how to get the json out of our
> ajax request.
> how can we get the json out of our ajax request?
> On Wednesday, March 13, 2013 4:42:30 PM UTC+1, Gert V wrote:
>> We use pyramid and chameleon template.
>> Currently we have a page where users can fill in a table.
>> This table has a variable lenght because rows are added dynamically.
>> We want to get all the content of the table and put it in a list, so we
>> send it to our database.
>> The biggest problem is that we don't know how to send the data to a list
>> and get it to our vieuw.
>> can some1 help me with this problem?
>> thanks in advance.
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscribe@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
-- Au revoir, et tous mes voeux pour un avenir plein de succès et de bonheur ––