Hi! You probably want to use range() function for that. > On 6 Jan 2017, at 18:21, MikeKJ <mike.jo...@paston.co.uk> wrote: > > So I have a form of post values and one of the values is the number of > resources to be used, what I want to do is save multiple instances of the > form data based on the resource quantity to be used. > > ResourceObject is the model name > > views.py snippet > [code] > rqb = int(resource_quantity_used) > for i in rqb: > i = ResourceObject() > i.resource = resource > i.resource_quantity_used = resource_quantity_used > i.date = date //date of usage > i.start = start //start time of usage > i.hours = hours //number of hours to be used for > i.save() > [/code] > this currently throws 'int' object is not iterable at 'for i in rqb' if I > use for i in resource_quantity_used it doesnt iterate on the value of > resource_quantity_used. > > Many thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com > <mailto:django-users+unsubscr...@googlegroups.com>. > To post to this group, send email to django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-users > <https://groups.google.com/group/django-users>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/47c6cd40-5d7f-4d10-8d3b-8f9e580485c8%40googlegroups.com > > <https://groups.google.com/d/msgid/django-users/47c6cd40-5d7f-4d10-8d3b-8f9e580485c8%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/DDEF6170-3E33-4E04-BADB-4F2372889FBF%40gmail.com. For more options, visit https://groups.google.com/d/optout.