There's an error in your quoted example:

> dataset = Author.select()
> record=get(1)
> fieldname = "name"

it needs to say record = Author.get(1)

Instead of data = getattr(record, fieldname), which looks ugly to me,
perhaps you could consider using simply data = record.name

If the issue is that your field name is being determined
programatically, so you don't know it ahead of time, you could always
use the following:
data = eval("record.%" % (fieldname,))

Reply via email to