• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python DAO.DAO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update_contribution_request_count

	def update_contribution_request_count(tale_id, value):
		DAO.update(
			'''
			UPDATE anaddventure.tale
				SET tale_contribution_request_count = tale_contribution_request_count + (%s)
				WHERE tale_id = (%s)
			''',
			(value, tale_id)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:9,代码来源:Tale.py


示例2: update_follow_count

	def update_follow_count(tale_id, value):
		DAO.update(
			'''
			UPDATE anaddventure.tale
				SET tale_follow_count = tale_follow_count + (%s)
				WHERE tale_id = (%s)
			''',
			(value, tale_id)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:9,代码来源:Tale.py


示例3: update_all

	def update_all(tale_id, title, description, category, license_id):
		DAO.update(
			'''
			UPDATE anaddventure.tale
				SET tale_title = (%s),
					tale_description = (%s),
					tale_category = (%s),
					tale_license = (%s)
				WHERE tale_id = (%s)
			''',
			(title, description, category, license_id, tale_id)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:12,代码来源:Tale.py


示例4: select_viewable_by_creator_id_and_viewer_id

	def select_viewable_by_creator_id_and_viewer_id(
			creator_id, viewer_id, rows = None
		):
		return Tale._construct_tale_objects(
			DAO.select_by(
				'''
				SELECT DISTINCT
					tale_id, tale_title, tale_description,
					tale_category, tale_creator, tale_license,
					tale_star_count, tale_follow_count,
					tale_contribution_request_count, tale_creation_datetime
					FROM anaddventure.tale INNER JOIN anaddventure.invitation ON
					tale_creator = (%s) AND
					(
						tale_category = 1 OR
						(
							invitation_creator = tale_creator AND
							invitation_invited = (%s) AND
							invitation_tale_id = tale_id
						) OR
						tale_creator = (%s)
					)
					ORDER BY tale_star_count DESC
				''',
				(creator_id, viewer_id, viewer_id),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:28,代码来源:Tale.py


示例5: select_tales_other_creator

	def select_tales_other_creator(user_id, viewer_id, rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				'''
				SELECT DISTINCT
					tale_id, tale_title, tale_description,
					tale_category, tale_creator, tale_license,
					tale_star_count, tale_follow_count,
					tale_contribution_request_count, tale_creation_datetime
					FROM anaddventure.tale INNER JOIN anaddventure.contribution_request ON
					contribution_request_system_user_id = (%s) AND
					tale_creator != contribution_request_system_user_id AND
					tale_id = contribution_request_tale_id AND
					(
						tale_category = 1 OR
						(
							(
								SELECT COUNT(*) FROM anaddventure.invitation WHERE
									invitation_creator = tale_creator AND
									invitation_invited = contribution_request_system_user_id
							) > 0 AND
							(
								SELECT COUNT(*) FROM anaddventure.invitation WHERE
									invitation_creator = tale_creator AND
									invitation_invited = (%s)
							) > 0
						)
					)
					ORDER BY tale_star_count DESC
				''',
				(user_id, viewer_id),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:34,代码来源:Tale.py


示例6: select_top_ten_order_by_star_count

	def select_top_ten_order_by_star_count():
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_category = 1 ORDER BY tale_star_count DESC LIMIT 5",
				()
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:7,代码来源:Tale.py


示例7: select_all

	def select_all(rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale",
				(),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例8: select_by_creator_id_and_full_title

	def select_by_creator_id_and_full_title(creator_id, title, rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_creator = (%s) AND tale_title ILIKE (%s)",
				(creator_id, title),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例9: select_by_license_id

	def select_by_license_id(license_id, rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_license = (%s)",
				(license_id, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例10: select_by_creator_id

	def select_by_creator_id(creator_id, rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_creator = (%s)",
				(creator_id, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例11: select_by_category

	def select_by_category(category = '', rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_category = (%s)",
				(category, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例12: select_count_by_title

	def select_count_by_title(title = '', rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT COUNT(tale_id) FROM anaddventure.tale WHERE tale_title ILIKE (%s)",
				('%' + title + '%', ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例13: select_by_full_title

	def select_by_full_title(title = '', rows = None):
		return Tale._construct_tale_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.tale WHERE tale_title ILIKE (%s)",
				(title, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Tale.py


示例14: select_all

	def select_all(rows = None):
		return License._construct_license_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.license",
				(),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:License.py


示例15: select_by_name

	def select_by_name(name, rows = None):
		return License._construct_license_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.license WHERE license_name ILIKE (%s)",
				('%' + name + '%', ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:License.py


示例16: select_by_id

	def select_by_id(id, rows = None):
		return Password_Change_Requests._construct_password_change_request_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.password_change_requests WHERE password_change_requests_id LIKE (%s)",
				(hashlib.sha256(id.encode('utf-8')).hexdigest(), ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Password_Change_Requests.py


示例17: select_by_id

	def select_by_id(id, rows = None):
		return License._construct_license_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.license WHERE license_id = (%s)",
				(id, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:License.py


示例18: select_by_tale_id

	def select_by_tale_id(tale_id, rows = None):
		return Contribution_Request._construct_contribution_request_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.contribution_request WHERE contribution_request_tale_id = (%s)",
				(tale_id, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Contribution_Request.py


示例19: select_by_was_closed

	def select_by_was_closed(was_closed, rows = None):
		return Contribution_Request._construct_contribution_request_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.contribution_request WHERE contribution_request_was_closed = (%s)",
				(was_closed, ),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Contribution_Request.py


示例20: select_all

	def select_all(rows = None):
		return Chapter._construct_chapter_objects(
			DAO.select_by(
				"SELECT * FROM anaddventure.chapter",
				(),
				rows
			)
		)
开发者ID:tayllan,项目名称:anaddventure,代码行数:8,代码来源:Chapter.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python GameLevel.GameLevel类代码示例发布时间:2022-05-27
下一篇:
Python Corporation.Corporation类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap