Johann answer here: https://groups.google.com/forum/?fromgroups#!topic/web2py/0VpTEoZ1tkc
Anthony almost at the end of this thread : https://groups.google.com/forum/?fromgroups#!topic/web2py/b5VgstnvY3Y For the postgres views, you can define them as they were tables and set a restricted access permission on them with RBAC built-in web2py, so, for view you could have read and select of a record the other CRUD permissions will not be available to all user, since you can't create new record for a view, update or delete them. You will need that your view contain at least a fake ID unique field to make it works with web2py. About views I don't know if it best practice, but it works quite well for me. An other solution, is to define you views into web2py as set : your_set = db(db.table.field == something_that_filter) And then use the set in select when you are ready : your_set.select(db.table.ALL) # for example if you want all the column your_set.select(db.table.f1, db.table.f2, etc.) # if you want only particular columns Hopes it help. Richard On Mon, Jun 4, 2012 at 8:56 AM, bob <bmacc...@gmail.com> wrote: > > In the old days I would just create a database view on a subset of a table > that I wanted to allow other developers to access (assuming read only), > however I'm not sure if that's the best thing to do with web2py. > > I have a table that has: > > last_name > first_name > etc > including some 'internal' columns that I don't want to expose on any form > or service. > > Any thoughts on the best way to implement this? > > I'm thinking: > > a: database view (postgresql in this case), issues being no 'id' in the > view and I'm not sure how best to maintain that. > > b: a new .py that takes the full record and returns the subset. upside > - it would be a single point of maintenance, question is where would this > live (in the models, it's not a controller so it doesn't really fit there)? > > c: ?? > > thanks for any suggestions, > bobm > >