that would be useful - to map DAL field names (in general) to database field names.... Example:
Legacy DB has short, obtuse names; you write code to handle OLD database, and want field names that actually make your code readable (!), and perhaps even make reasonable first level forms. This is sort of like creating DAL views into the data (note: you could do the same w/ the DB, and operate on the view). What is the argument (then) for creating a view in DAL / web2py --- instead of doing it in the database? I can think of one argument against: this kind of mapping is not portable (it is specific to a database, a VERY strong argument that it's mapping should be done close to the database). Even sqlite has views! So - I think this IS handly - and you can already do it at the DB end (where it would seem it better belongs in any case). I welcome further discussion on this. Regards, Yarko On Tue, Mar 10, 2009 at 8:59 PM, DenesL <[email protected]> wrote: > > Massimo, > could you please explain the reason(s) for having the ID field in a > table?. > > I see it being used to make each row unique. > It also makes a very convenient index: small, anonymous, sortable, ... > > But, it also hampers the use of web2py with existing tables. > IMHO it should be possible to alias the id field to any existing > primary key(s). > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

