db.define_table('genus',
Field('description'),
format = '%(description)s')
db.define_table('animal',
Field('species'),
Field('genus', 'reference genus'))
def animal():
animals = db().select(db.animal.ALL).render()
return dict(animals=animals)
Thanks Leonel
export_to_csv_file is actually a method of Rows, when you call render you get a generator that returns the representation for each row, that's not a Rows instance.You can actually just use export_to_csv_file passing it the argument represent=True and it will use the field's represent.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/z7FXwG9CsO4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.