2011/11/8 BrendanC <bren...@gmail.com> > Daniel, > Not sure what you are asking, but this might help you: > > Virtual fields are otherwise known as 'computed columns' in database terms > - if that is what you are familiar with. e.g. Sum, Count, Min, Max, etc as > these values are derived from underlying table data in a database. > > A database view is something entirely different - think of it as a virtual > table or a stored query than can expose either a subset of table columns or > a query that joins multiple tables and shows just the columns you want. > Views are very commonly used in legacy type applications (for security and > performance reasons - e.g. hide the employee salary info by creating a view > that excludes that data element). > > I don't know when I start confusing Virtual Fields with Virtual Tables, an so I was overestimating what I can do with Virtual Fields.
When you said "is commonly used in legacy applications" you mean that now they are not used very much? IIRC, Views are a lot faster than doing a Join from the app. > In the world of web development (Web2py, Django, Rails etc) database > access is managed primarily by ORM's. For the most part these are not very > 'View' friendly - you have to jump through a few hoops to use a view and > there are some also potential maintenance issues. (FWIW views are very > useful for simplifying complex queries and it's a pity that they are not > well supported in most web environments). > > Hope this helps, > BrendanC > > I'm agree with you. I also can't understand why Databases Views are not so important in Web2py (et al). The only way I see to use Database's Views in web2py is with db.extecutesql statement. I hope some other can answer us. Thank you Brendan! You helped me a lot.