getting data from a dictionary in a view

18 views
Skip to first unread message

MikeKJ

unread,
Oct 31, 2012, 7:29:53 AM10/31/12
to django...@googlegroups.com
I want to interrogate a dictionary for a particular text

     cursor = connection.cursor()
     cursor.execute("SELECT distinct feature, featuredetails from features where the_id = %s", [id])
     feature = dictfetchall(cursor)

results in
[{'featuredetails': u'', 'feature': u'TV_SET'}, {'featuredetails': u'', 'feature': u'INVERTER'}, {'featuredetails': u'', 'feature': u'HEATING'}]

So I want to know if the key 'feature' contains TV_SET or INVERTER or HEATING

Been trying various things for hours and not got anywhwere so far so any help would be much appreciated

MikeKJ

unread,
Oct 31, 2012, 9:54:07 AM10/31/12
to django...@googlegroups.com

MikeKJ

unread,
Oct 31, 2012, 1:14:11 PM10/31/12
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages