Hi all,
I am relatively new to SQLAlchemy and ORMs in general and have some
questions for you!

I am developing a library, for dealing with neuron morphologies. A
problem that I have had in the past is that dealing with many files
all over the place makes things unwieldy, so want the options to store
the data in a database.

At the moment, I have a class hierachy already built, with no database
connections or management. It is important that the library can also
be used by people who do not SQLAlchemy install on their systems.

The library is fairly modular, I had planned something along the lines
of:


./dbcontrol/dbcontrol.py
class DBController(Borg):

  def isUsingDB():
       #read someconfigfile to determine whether db in use



./core/__init__.py
from dbcontrol/dbcontrol import DBController
if DBController.isUsingDB():
   from core.morphology_DB import Morphology
   #And all other objects to be stored in db
else:
   from core.morphology_NoDB import Morphology
   #And all other objects not to be stored (freestanding)


./core/morphology_NoDB.py
class Morphology():
    def __init__(self,name, otherparams):
        self.name = name
        self.otherparams = otherparams
    def MyMethod(self)
        #do stuff

./core/morphology_DB.py
class Morphology():
        name = Column(...)
        otherparams = Column(...)
    def __init__(self,name, otherparams):
        pass
    def MyMethod(self)
        #do stuff



Is this the way people would recommend going about this problem??
Any thoughts would be gratefully recieved; before I embark on possibly
doubling the size of my class hierachy :-)

Cheers,

Mike




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to