2009/4/29 ae <[email protected]> > > I'm struggling with how to handle a database that already exists. > I've written model code for many of the tables and I can access them, > but many others don't have 'id' fields. One table has a field that is > an enum(). > > If I must resort to using db.executesql(), how should I organize the > code so that MVC principals are observed? > > Any help appreciated. > > ae > >
There are currently some threads in this group addressing that kind of situation (as well in the book): two options: a- alter the tables and add an id field (with a legacy database this might be a real problem). b- create views (read only or not depending on the case) and add an "id" field to them (maybe mapping to an already existing primary key -numbers only-). Anyway, search and read the group's archives, wiser people than me has already addressed this issue. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

