I have the following code except that gives me the following list of tuples
if request.method == 'POST':
checkbox_values = request.form.getlist('service_name')
print(type(checkbox_values)) //for debugging
print(checkbox_values) //for debugging
[u"(u'ZOL Zimbabwe', u'Fibre Internet')", u"(u'ZOL Zimbabwe', u'Wimax Internet')", u"(u'Utande Internet Services', u'Fibre Internet')", u"(u'Utande Internet Services', u'Wimax Internet')"]
In simple english , the first value in every tuple is the ISP name and the second value is the service provided by that ISP
What i need to achieve is being able to have a reference of the first value and the second value.
If i do this
values = [u"(u'ZOL Zimbabwe', u'Fibre Internet')", u"(u'ZOL Zimbabwe', u'Wimax Internet')", u"(u'Utande Internet Services', u'Fibre Internet')", u"(u'Utande Internet Services', u'Wimax Internet')"]
for x in value:
print k
i get this
(u'ZOL Zimbabwe', u'Fibre Internet')
(u'ZOL Zimbabwe', u'Email Hosting')
(u'Utande Internet Services', u'Fibre Internet')
(u'Utande Internet Services', u'Wimax Internet')
(u'Utande Internet Services', u'Email Hosting')
i need a way of referencing these values so i can grab them and insert into a database
i looked into these links ,but every method is giving me an error
iterating quickly through list of tuples
and I am still reading those links ,in case i am missing something ,someone can point me to the right direction