• 3531 views
  • 0 comments
  • loading...

If you need to add custom attributes to fields, you can simply do this:

db.table.field.extra = {}
"extra" is not a keyword ; it's a custom attributes now attached to the field object. You can do it with tables too but they must be preceded by an underscore to avoid naming conflicts with fields:



db.table._extra = {}

loading...

Sources / Reference

" Web2py Book - Chapter 6 Database Abstraction Level" is licensed under Creative Common License BY-NC-ND 3.0


Comments

loading...

Powered by
Web2py

Hosted on
www.pythonanywhere.com
(affiliated link)