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


Python databaseinterface.DatabaseInterface类代码示例

本文整理汇总了Python中analytics.databaseinterface.DatabaseInterface的典型用法代码示例。如果您正苦于以下问题:Python DatabaseInterface类的具体用法?Python DatabaseInterface怎么用?Python DatabaseInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: add

	def add(cls, follower, following, weight=1):
		""" Returns 0 if it """
		cursor = dbi.execute(
			"INSERT IGNORE INTO analytics_follow (follower,following,weight) VALUES(%s,%s,%s)"
			,(follower,following,weight)
		)
		return (cursor.lastrowid!=0)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:7,代码来源:follow.py

示例2: remove_comment

	def remove_comment(cls, usr, content):
		dbi.execute(
			"UPDATE analytics_content SET comments=comments-1 WHERE content=%s"
			,(content,)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:content.py

示例3: add_invite

	def add_invite(cls, follower, following):
		cls.assert_exists(follower, following)
		dbi.execute(
			"UPDATE analytics_follow SET invites = invites+1 WHERE follower=%s and following=%s"
			,(follower, following)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:follow.py

示例4: remove_comment

	def remove_comment(cls, follower, following):
		dbi.execute(
			"UPDATE analytics_follow SET comments = comments-1 WHERE follower=%s and following=%s"
			,(follower, following)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:follow.py

示例5: remove

	def remove(cls, follower, following):
		cursor = dbi.execute(
			"DELETE FROM analytics_follow WHERE follower=%s and following=%s"
			,(follower,following)
		)
		return (cursor.rowcount!=0)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:follow.py

示例6: remove_comment

 def remove_comment(cls, usr, content, tabloid):
     dbi.execute(
         "UPDATE analytics_tabloidentry SET comments=comments-1 WHERE tabloid=%s and content=%s"(tabloid, content)
     )
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:4,代码来源:tabloidentry.py

示例7: remove_view

 def remove_view(cls, usr, content, tabloid):
     dbi.execute("UPDATE analytics_tabloidentry SET views=views-1 WHERE tabloid=%s and content=%s"(tabloid, content))
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:2,代码来源:tabloidentry.py

示例8: add

	def add(cls, usr, content):
		dbi.execute(
			"INSERT INTO analytics_usr_seen (usr,content) VALUES(%s,%s) "
			,(usr, content)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:user_seen.py

示例9: remove_invite

	def remove_invite(cls, usr, tabloid):
		dbi.execute(
			"UPDATE analytics_tabloid SET invites=invites-1 WHERE tabloid=%s"
			,(tabloid,)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:tabloid.py

示例10: add_invite

	def add_invite(cls, usr, tabloid):
		cls.assert_exists(tabloid)
		dbi.execute(
			"UPDATE analytics_tabloid SET invites=invites+1 WHERE tabloid=%s"
			,(tabloid,)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:tabloid.py

示例11: get_owner

	def get_owner(cls, tabloid):
		row = dbi.execute("SELECT usr FROM analytics_tabloid WHERE tabloid=%s",(tabloid,)).fetchone()
		if row is not None:
			return row["usr"]
		else:
			return None
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:tabloid.py

示例12: remove_view

	def remove_view(cls, usr, tabloid):
		dbi.execute(
			"UPDATE analytics_tabloid SET views=views+1 WHERE tabloid=%s"
			,(tabloid,)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:tabloid.py

示例13: add_view

	def add_view(cls, usr, tabloid):
		cls.assert_exists(tabloid)
		dbi.execute(
			"UPDATE analytics_tabloid SET views=views+1 WHERE tabloid=%s"
			,(tabloid,)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:tabloid.py

示例14: add

	def add(cls, usr, tabloid):
		dbi.execute(				
			"INSERT INTO analytics_tabloid (tabloid,usr) VALUES(%s,%s)"
			,(tabloid,usr)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:5,代码来源:tabloid.py

示例15: add_time_spent

	def add_time_spent(cls, usr, content):
		cls.assert_exists(content)
		dbi.execute(
			"UPDATE analytics_content SET time_spent=time_spent+%s WHERE content=%s"
			,(content,time_spent)
		)
开发者ID:krishnangovindraj,项目名称:ami_analytics,代码行数:6,代码来源:content.py


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