Ive found a Niplhod's answer that solves this.
1.-Create a dummy table:
#create a dummy table with the same structure as the results
db.define_table("results",
Field("field1", "string")
, Field("field2", "string")
, migrate = False
)
2.- Execute any custom sql with that structure:
rows = db.executesql("SELECT field1, field2 FROM anytable", fields=[db.
results.field1, db.results.field2])
print rows
<Rows (1)>
So with any random sql you can get all the Rows features. This is so cool.
I love it.
--
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 the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.