[PonyORM-list] ponyorm - how to use

Alexey Malashkevich alexeymalashkevich at gmail.com
Tue Apr 1 09:30:00 UTC 2014


At this point Pony doesn't generate models from the database tables.
However Pony can map entities to legacy databases.
For this purpose you can use parameters "_table_", "column", "columns":

    class MyEntity(db.Entity):
        _table_ = "legacy_table"
        attr1 = Required(unicode, column="db_column1")

Check the "Mapping customization" part in the Pony documentation for an
example
 http://doc.ponyorm.com/entities.html#mapping-customization
Let us know if you have any further questions.

Regards,
Alexey


On Tue, Apr 1, 2014 at 8:01 AM, 王飞 <gf0842wf at gmail.com> wrote:

> Hi! How can I use pony to generate a model from a legacy database?
> Look forward to your reply.Thanks!
>
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
> /ponyorm-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20140401/dc8259cc/attachment.html>


More information about the ponyorm-list mailing list