当前位置: 首页>>代码示例>>Python>>正文


Python Mapper.__init__方法代码示例

本文整理汇总了Python中mapper.Mapper.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Mapper.__init__方法的具体用法?Python Mapper.__init__怎么用?Python Mapper.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mapper.Mapper的用法示例。


在下文中一共展示了Mapper.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import __init__ [as 别名]
 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))
开发者ID:denisfortun,项目名称:scipion,代码行数:10,代码来源:sqlite.py

示例2: __init__

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import __init__ [as 别名]
 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))
开发者ID:azazellochg,项目名称:scipion,代码行数:13,代码来源:sqlite.py

示例3: __init__

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import __init__ [as 别名]
 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
开发者ID:I2PC,项目名称:scipion,代码行数:22,代码来源:xmlmapper.py


注:本文中的mapper.Mapper.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。