Hi there,

I would like to reuse my model in a non-TG python application  - to keep me DRY.

Is there an expression I can evaluate in model.py to determine if I'm
running inside CherryPy/TurboGears or not?

Something like:


from sqlalchemy import *

if runningingcherrypy:
  from turbogears import identity
  from turbogears.database import PackageEngine
  engine = __engine__ = PackageEngine("softproof")
  __meta__ = BoundMetaData(__engine__)

  .. classes dealing with TG identiti etc ...

else:
  __meta__ = Metadata()

.. classes to use in both TG and other app...

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to