Exemplo n.º 1
0
 def __init__(self, dbName, dictClasses=None):
     Mapper.__init__(self, dictClasses)
     self.__initObjDict()
     self.__initUpdateDict()
     try:
         self.db = SqliteObjectsDb(dbName)
     except Exception, ex:
         raise Exception("Error creating SqliteMapper, dbName: %s\n error: %s" % (dbName, ex))
Exemplo n.º 2
0
 def __init__(self, dbName, dictClasses=None):
     Mapper.__init__(self, dictClasses)
     self.__initObjDict()
     self.__initUpdateDict()
     try:
         self.db = SqliteObjectsDb(dbName)
     except Exception, ex:
         raise Exception(
             'Error creating SqliteMapper, dbName: %s\n error: %s' %
             (dbName, ex))
Exemplo n.º 3
0
 def __init__(self, dbName, dictClasses=None, tablePrefix=''):
     Mapper.__init__(self, dictClasses)
     self._objTemplate = None
     try:
         self.db = SqliteFlatDb(dbName, tablePrefix)
         self.doCreateTables = self.db.missingTables()
         
         if not self.doCreateTables:
             self.__loadObjDict()
     except Exception, ex:
         raise Exception('Error creating SqliteFlatMapper, dbName: %s, tablePrefix: %s\n error: %s' % (dbName, tablePrefix, ex))
Exemplo n.º 4
0
    def __init__(self, dbName, dictClasses=None, tablePrefix=''):
        Mapper.__init__(self, dictClasses)
        self._objTemplate = None
        try:
            self.db = SqliteFlatDb(dbName, tablePrefix)
            self.doCreateTables = self.db.missingTables()

            if not self.doCreateTables:
                self.__loadObjDict()
        except Exception, ex:
            raise Exception(
                'Error creating SqliteFlatMapper, dbName: %s, tablePrefix: %s\n error: %s'
                % (dbName, tablePrefix, ex))
Exemplo n.º 5
0
    def __init__(self, dbName, dictClasses=None):
        Mapper.__init__(self, dictClasses)
        self.__initObjDict()
        self.__initUpdateDict()
        # from which directory we are working with this mapper
        # and related objects stored/retrieved
        self._workingDir = None

        try:
            self.db = SqliteObjectsDb(dbName)
        except Exception, ex:
            raise Exception(
                'Error creating SqliteMapper, dbName: %s\n error: %s' %
                (dbName, ex))
Exemplo n.º 6
0
 def __init__(self, filename, dictClasses=None, rootName='ALL', **args):
     self.filename = filename
     if exists(filename):
         self._read()
     else:
         self._create(rootName, **args)
     Mapper.__init__(self, dictClasses)
     # Objects map (id should be defined)
     self.objDict = {}
     # Store some objects during parsing
     # that have some Pointer attributes and need to be fixed later
     self.pendingPtrDict = {}
     # This dictionary serve to define how to write classes
     # for example if the pair 'Integer': 'attribute' is present
     # all Integer will be store as attributes in the xml
     # possible values are:
     #   'attribute', 'class_only', 'class_name', 'name_class', 'name_only'
     self.classTags = {}
     # Counter to provide default objects id's
     self.objCount = 0
Exemplo n.º 7
0
 def __init__(self, filename, dictClasses=None, rootName='ALL', **args):
     self.filename = filename        
     if exists(filename):
         self._read()           
     else:
         self._create(rootName, **args)
     Mapper.__init__(self, dictClasses)
     # Objects map (id should be defined)  
     self.objDict = {}      
     # Store some objects during parsing
     # that have some Pointer attributes and need to be fixed later 
     self.pendingPtrDict = {}
     # This dictionary serve to define how to write classes
     # for example if the pair 'Integer': 'attribute' is present
     # all Integer will be store as attributes in the xml
     # possible values are: 
     #   'attribute', 'class_only', 'class_name', 'name_class', 'name_only'
     self.classTags = {} 
     # Counter to provide default objects id's
     self.objCount = 0