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


Python User.create_or_update方法代码示例

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


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

示例1: __init__

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_or_update [as 别名]
 def __init__(self, file_name):
   DataFile.__init__(self, file_name)
   result_file_info = self._get_file_info()
   self.topic = Topic.create_or_update(result_file_info['topic_id'])
   self.user = User.create_or_update(result_file_info['user_id'])
   self.query = Query.create_or_update(result_file_info['query_id'], topic=self.topic, user=self.user)
   self.__parse()
开发者ID:fire-uta,项目名称:iiix-data-parser,代码行数:9,代码来源:result_file.py

示例2: __parse

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_or_update [as 别名]
 def __parse( self ):
   with open( self.file_name, 'r' ) as result_file:
     result_reader = csv.DictReader( result_file, delimiter=',')
     for row in result_reader:
         topic = Topic.create_or_update( row['topic'] )
         user = User.create_or_update( row['userid'] )
         condition = Condition.create_or_update( row['condition'] )
         autocomplete = row['autocomplete_used'] == 1
         query = Query.create_or_update( row['queryid'], topic = topic, user = user, condition = condition, autocomplete = autocomplete, query_text = row['terms'], precision = self.__build_precision_dict( row ) )
开发者ID:fire-uta,项目名称:iiix-data-parser,代码行数:11,代码来源:queries_summary_file.py

示例3: __init__

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import create_or_update [as 别名]
 def __init__(self, file_name):
   DataFile.__init__(self, file_name)
   result_file_info = self._get_file_info()
   self.topic = Topic.create_or_update( result_file_info['topic_id'] )
   self.user = User.create_or_update( result_file_info['user_id'] )
   self.condition = Condition.create_or_update( result_file_info['condition'] )
   self.__create_or_update_session()
   self.query = Query.create_or_update( result_file_info['query_id'], topic = self.topic, user = self.user, session = self.session )
   self.actions = self.__parse()
   self.topic.add_actions( self.actions )
   self.user.add_actions( self.actions )
   self.query.add_actions( self.actions )
   self.session.add_actions( self.actions )
   self.session.add_query( self.query )
开发者ID:fire-uta,项目名称:iiix-data-parser,代码行数:16,代码来源:log_file.py


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