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.
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/47c6cd40-5d7f-4d10-8d3b-8f9e580485c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to