Re: how to do this?
oh yeah. thats true, i thought, that for-loop which Kenneth proposed doesnot create fields but it does, so in every loop there will be a new html field created if i do like this:
{% for p in products %}
<p >{{p.arg1}} and {{p.arg2}}</p>
{% endfor %}
Many thanks to you and Kenneth again
Am Samstag, 26. Mai 2012 23:31:48 UTC+2 schrieb Daniel Roseman:
On Saturday, 26 May 2012 15:03:47 UTC+1, doniyor wrote:the reason why i want to do this is this:the user should be able to select products from products table as many as he wants, at each selection i will save the product information in db, then the user clicks on "book" button, which leads to another book.html template where extra fields should be created for data of each selected product.for example: user has selected 3 items from products table and then goes to next step where he sees what he has selected and then he submits the booking with some last information of his personal. the point is that if he has selected 3 items, then there are 3 items in db, so i create 3 html input fields for each selected item where i will render the data that i get from db. thats why i want to create these html input fields according to the number of items in db..But that doesn't explain why you want to do it. Say you do as you describe, and you've got x separate "htmls", however that happens. What do you do with them now? They're of no use unless you show them to the user. So you need to somehow concatenate them and include them into a surrounding HTML page. Which is exactly what Kenneth's suggestion of doing it all in the template would achieve.--DR.
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pJ_YB--TsBIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home