Or you can use full blown EAV - http://en.wikipedia.org/wiki/Entity-attribute-value_model. It may be overkill in many cases but is great for large sparse matrices, depends on the details of your project...
- [web2py] Dealing with arbitary user defined DAL fields seongjoo
- Re: [web2py] Dealing with arbitary user defined DAL field... Bruno Rocha
- Re: [web2py] Dealing with arbitary user defined DAL f... seongjoo
- [web2py] Re: Dealing with arbitary user defined D... pepper_bg
- Re: [web2py] Dealing with arbitary user defined D... seongjoo