<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello Alexey,<br>
<br>
Thank you for your reply. Yes, it would help, if it worked for
packages too (I usually recommend using a single class per module,
or per file, anyway). If this prefix can be defined in the package
'__init__.py' file or something like that, it would definitely help
a lot. And make names much more pleasant even for those who have to
work with the DB itself, since my idea (of having the full path of
each class as a name) would make names like
'path_subpath_modulename_pluralclassname' which isn't very
beautiful, your solution seems better.<br>
<br>
Thanks again,<br>
<br>
Vincent<br>
<br>
<div class="moz-cite-prefix">Le 6/18/2015 9:59 AM, Alexey
Malashkevich a écrit :<br>
</div>
<blockquote
cite="mid:CABuFHj7enxX8f4_vuyAOCxbjmY6dfL1PkJGb4W72vdTiS_08Hg@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Vincent,
<div><br>
</div>
<div>We thought about your request a little bit and here what we
can suggest.</div>
<div>We could introduce an ability to declare the variable in a
module such as</div>
<div><br>
</div>
<div>PONY_TABLE_PREFIX = "some_prefix_"</div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div>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?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Alexey</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jun 15, 2015 at 9:27 PM,
Vincent LE GOFF <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:vincent.legoff.srs@gmail.com" target="_blank">vincent.legoff.srs@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
everyone,<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks for your help and your work,<br>
<br>
Vincent<br>
_______________________________________________<br>
ponyorm-list mailing list<br>
<a moz-do-not-send="true"
href="mailto:ponyorm-list@ponyorm.org" target="_blank">ponyorm-list@ponyorm.org</a><br>
<a moz-do-not-send="true"
href="/ponyorm-list"
rel="noreferrer" target="_blank">/ponyorm-list</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ponyorm-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ponyorm-list@ponyorm.org">ponyorm-list@ponyorm.org</a>
<a class="moz-txt-link-freetext" href="/ponyorm-list">/ponyorm-list</a>
</pre>
</blockquote>
<br>
</body>
</html>