[PonyORM-list] pony entities in multiple modules

Goldberg, Arthur P arthur.p.goldberg at mssm.edu
Wed Nov 5 18:29:15 UTC 2014


Hello Alexander

 let me be more specific.
 I have a number of modules that query, update, delete against the database.
 I want to centralize all the database bind, mapping,  and table deletion operations in one module that other modules can call.
 Here's my effort to write that centralized module.
 The only method is:
Connect( DBMS='arthur_minerva', entityNames=[], dropAndCreateTable=False, debug=False )
DBMS is simply a key into a dictionary of database credential parameters. That works fine, and is used by bind.
entityNames is a list of entities;  I want to connect() to make sure that if an  entity is declared as a pony db  entity then it is in the database
dropAndCreateTable  controls whether tables are dropped; if it is true then tables for all entities should be dropped and then created

 with the call:
Connect( MyDropAndCreateTables.args.DBMS, entityNames='CNV Subject'.split(),
            dropAndCreateTable=True, debug=True )
 this does not work, however:


I am using mysql.

On Nov 4, 2014, at 4:39 PM, Alexander Kozlovsky <alexander.kozlovsky at gmail.com<mailto:alexander.kozlovsky at gmail.com>> wrote:
Hi Arthur,

> How can I have the general purpose programs load all the pony entities, but then use only those specified on a command line?

What do you mean by 'use'? Why this general purpose program can't use all entities? Can you provide some example?


On Wed, Nov 5, 2014 at 12:24 AM, Goldberg, Arthur P <arthur.p.goldberg at mssm.edu<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailto-3Aarthur.p.goldberg-40mssm.edu&d=AAMFaQ&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=TntoeYH7lekXzpBRjXwLTkqiWTbWAvp3pHKo_kZp5qI&m=-l9d_YgpS5Br4HVerevDUPDePIdahRQvh6kua6GEKCg&s=8BLVACjagdDyNx90SlAn1F7tsSllEw4K5MHFxb6KM1o&e=>> wrote:
Hi Guys

I've pony entities (class foo(db.Entity), etc.) definitions in multiple modules. And I've several general purpose programs: 1) connect to the dbms and optionally create tables, 2) load a file into a table, etc.
How can I have the general purpose programs load all the pony entities, but then use only those specified on a command line?

Is this clear?

thanks
Arthur

_______________________________________________
ponyorm-list mailing list
ponyorm-list at ponyorm.org<mailto:ponyorm-list at ponyorm.com>
/ponyorm-list<https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman-2Dmail5.webfaction.com_listinfo_ponyorm-2Dlist&d=AAMFaQ&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=TntoeYH7lekXzpBRjXwLTkqiWTbWAvp3pHKo_kZp5qI&m=-l9d_YgpS5Br4HVerevDUPDePIdahRQvh6kua6GEKCg&s=ZTWdoePYiHrdwy3YThpUs2-mmvop7hGq2ibwteX9CYA&e=>

_______________________________________________
ponyorm-list mailing list
ponyorm-list at ponyorm.com<mailto:ponyorm-list at ponyorm.com>
https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman-2Dmail5.webfaction.com_listinfo_ponyorm-2Dlist&d=AAIGaQ&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=TntoeYH7lekXzpBRjXwLTkqiWTbWAvp3pHKo_kZp5qI&m=-l9d_YgpS5Br4HVerevDUPDePIdahRQvh6kua6GEKCg&s=ZTWdoePYiHrdwy3YThpUs2-mmvop7hGq2ibwteX9CYA&e=

---

Arthur Goldberg
Associate Professor of Psychiatry
Seaver Autism Center and Icahn Institute for Genomics & Multiscale Biology
Icahn School of Medicine at Mount Sinai
Seaver Center, Room ABE-33
212-241-4229
Arthur.Goldberg at mssm.edu<mailto:Arthur.Goldberg at mssm.edu>
Follow us on Twitter @IcahnInstitute<https://twitter.com/IcahnInstitute>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20141105/10263cca/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geneticsDBMScommon.py
Type: text/x-python-script
Size: 2224 bytes
Desc: geneticsDBMScommon.py
URL: </ponyorm-list/attachments/20141105/10263cca/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geneticsSubjects.py
Type: text/x-python-script
Size: 25393 bytes
Desc: geneticsSubjects.py
URL: </ponyorm-list/attachments/20141105/10263cca/attachment-0003.bin>


More information about the ponyorm-list mailing list