FormAlchemy / formalchemy

MIT License
81 stars 29 forks source link

Grid interface: iterate columns #48

Closed smurfix closed 10 years ago

smurfix commented 10 years ago

Instead of using a "public" method which starts with an underscore (which leads to errors if forgotten to call, and also some frameworks prevent calling of leading-underscore methods from template code for safety), just iterate the collection directly.

That is, instead of writing

for row in collection.rows:
    collection._set_active(row)
    … do something with this row

you can now simply write

for row in collection:
    … do something with this row