On Dec 30, 2010, at 10:19 AM, Carey Gagnon wrote:

> This successfully pulls the last builder added to the database with the
> following dataset:
> ({'id': 189L, 'buildername': u'last database entry'},)

[snip]

> For the life of me I haven't been able to successfully pull just the string
> I want from the dataset.  I've hunted the forums and the api doc without
> success.


        A dataset is just a tuple, in which each member is a dict. Assuming:

ds = ({'id': 189L, 'buildername': u'last database entry'},)

...you want the first 'record', so:

rec = ds[0]

'rec' is just a dict, so you get the buildername value like any other dict:

bname = rec["buildername"]



-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to