I am posting data from a page with a dynamic set of licenses, I'm using the license_name as they key for the post values, then im building a string from the posted values. However
I can't figure out how to iterate through the database object set. There is no other way for what im doing because im using this to insert data into vcenter directly through python code.
ive tried
licenses.Licenses
licenses('Licenses')
licenses['Licenses']
current code:
licenses = Licenses.objects.all()
insert_data = request.POST.copy()
for field, lis in licenses:
for lisc in insert_data[lis]:
license_tag += lisc + ','
I've tried
for lis in licenses:
for lisc in insert_data[lis]:
license_tag += lisc + ','
for lis in licenses:
for lisc in insert_data[lis['Licenses']]:
license_tag += lisc + ','
for lis in licenses:
for lisc in insert_data[lis('Licenses')]:
license_tag += lisc + ','
for lis in licenses:
for lisc in insert_data[lis.Licenses]:
license_tag += lisc + ','
licenses looks like, so its an object inside of a list, which means i should be able to access it as lis.objectname or licenses.objectname correct?
licenses | |
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9ef47463-cca9-4ca2-a12f-b62dfa0e7ccc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment