[PonyORM-list] Table names

Alexey Malashkevich alexeymalashkevich at gmail.com
Thu Jun 18 16:59:43 UTC 2015

Hi Vincent,

We thought about your request a little bit and here what we can suggest.
We could introduce an ability to declare the variable in a module such as

PONY_TABLE_PREFIX = "some_prefix_"

When Pony processes entity definitions, it checks if this variable is
declared in the current module. If it is, then Pony adds this prefix to all
table names. What do you think about this idea? Would it cover your needs?


On Mon, Jun 15, 2015 at 9:27 PM, Vincent LE GOFF <
vincent.legoff.srs at gmail.com> wrote:

> Hi everyone,
> I was wondering something very simple:  In an application with a lot of
> classes that should be saved in the database, name conflict isn't that
> scarce.  In fact, since I'm trying to design a modular project, everyone
> could add new classes.  Pony might not like that a bit if two classes have
> similar names.
> An obvious solution is to use the full names of classes
> (package.subpackage.subsubpackage....ClassName) instead.  We could use
> underscores instead of dots, dots are not a good idea in table names I
> guess.  I might be able to create a metaclass of some sort to do just
> that.  But perhaps there's an easier way to do it. Besides, I don't know if
> it would react well.
> Thanks for your help and your work,
> Vincent
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
> /ponyorm-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20150618/6b57b60f/attachment.html>

More information about the ponyorm-list mailing list