Can you create a custom database view and map the field?

On Apr 1, 12:06 am, Kevin Butler <kevinjbut...@gmail.com> wrote:
> This was posted as a comment 
> tohttp://mdp.cti.depaul.edu/AlterEgo/default/show/55:
> Which reads:
>
> > web2py can import tables saved in csv format therefore it can access legacy 
> > data.
> > web2py can also access existing databases directly (MySQL, PostgreSQL, 
> > SQLite and Oracle) if
> > each table has an auto increment field called "id" and if this is the field 
> > used for referencing.
>
> > Most legacy databases can be converted into the above format by using ALTER 
> > TABLE. If the legacy
> > database cannot be converted into such format, it probably has design 
> > issues and should be
> > reworked anyway. web2py tries to enforce good software engineering 
> > practice. HOWEVER, IN
> > REALITY THIS IS UNREALISTIC AND IS A GREAT DRAWBACK IN ANY ATTEMPT TO USE
> > WEB2PY ON LEGACY SYSTEMS.
>
> This really is inconvenient for legacy databases that are still in use
> by other applications.
>
> In my case, I want to read and possibly modify a user table belonging
> to a Dekiwiki installation, but because web2py will not be the
> exclusive owner of the table, I can't alter the table to meet web2py's
> requirements.
>
> The table has a "user_id" primary key, so if I could do something
> like:
>
> db.define_table( "users",
>   ...,
>   id="user_id",
>   migrate=False
>   )
>
> I'd be able to do use the web2py database layer, but as it is, I added
> code to use MySQLdb directly.
>
> kb
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to