import from a database / a string
since some time I try to find a more elegant solution:
modules of an application are stored in a database, and depending on the
logged on user different modules are integrated into the application.
actually I store the source-code in big text fields, get it and integrate
it via compile and execute.
exec obj in globals()
(with some try: and excepts:)
there could be some improvements by not executing in globals() ... but
I assume, there should be a better solution with the new import-
So I like to compile my module to an .pyo, store this .pyo into the
database, and do something like
import modulefromdatabase as specialname
I just can't figure out how, some materials about the new importhooks did
not help, neither did googling... can somebody push me in the correct
|All times are GMT. The time now is 12:45 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.