Beispiel #1
0
    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))
Beispiel #2
0
    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))
Beispiel #3
0
	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)
		)
Beispiel #4
0
	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)
		)
Beispiel #5
0
    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))
Beispiel #6
0
    def update_profile(user_id, name, email, biography, is_email_visible):
        DAO.update(
            """
			UPDATE anaddventure.system_user SET
				system_user_name = (%s),
				system_user_email = (%s),
				system_user_biography = (%s),
				system_user_is_email_visible = (%s)
				WHERE system_user_id = (%s)
			""", (name, email, biography, is_email_visible, user_id))
Beispiel #7
0
	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)
		)
    def update_title_and_content(contribution_request_id, title, content):
        return DAO.update(
            '''
			UPDATE anaddventure.contribution_request
				SET contribution_request_title = (%s),
					contribution_request_content = (%s)
				WHERE contribution_request_id = (%s)
			''', (title, content, contribution_request_id))
    def update_was_accepted(contribution_request_id, was_accepted):
        return DAO.update(
            '''
			UPDATE anaddventure.contribution_request
				SET contribution_request_was_accepted = (%s),
					contribution_request_was_closed = True
				WHERE contribution_request_id = (%s)
			''', (was_accepted, contribution_request_id))
	def update_title_and_content(contribution_request_id, title, content):
		return DAO.update(
			'''
			UPDATE anaddventure.contribution_request
				SET contribution_request_title = (%s),
					contribution_request_content = (%s)
				WHERE contribution_request_id = (%s)
			''',
			(title, content, contribution_request_id)
		)
	def update_was_accepted(contribution_request_id, was_accepted):
		return DAO.update(
			'''
			UPDATE anaddventure.contribution_request
				SET contribution_request_was_accepted = (%s),
					contribution_request_was_closed = True
				WHERE contribution_request_id = (%s)
			''',
			(was_accepted, contribution_request_id)
		)
Beispiel #12
0
 def update_title_and_content(chapter_id, title, content):
     return DAO.update(
         "UPDATE anaddventure.chapter SET chapter_title = (%s), chapter_content = (%s) WHERE chapter_id = (%s)",
         (title, content, chapter_id))
Beispiel #13
0
	def update_download_count(chapter_id):
		return DAO.update(
			"UPDATE anaddventure.chapter SET chapter_download_count = chapter_download_count + 1 WHERE chapter_id = (%s)",
			(chapter_id, )
		)
Beispiel #14
0
	def update_title_and_content(chapter_id, title, content):
		return DAO.update(
			"UPDATE anaddventure.chapter SET chapter_title = (%s), chapter_content = (%s) WHERE chapter_id = (%s)",
			(title, content, chapter_id)
		)
Beispiel #15
0
 def update_password(user_id, password):
     DAO.update(
         "UPDATE anaddventure.system_user SET system_user_password = (%s) WHERE system_user_id = (%s)",
         (hashlib.sha256(password.encode('utf-8')).hexdigest(), user_id))
Beispiel #16
0
 def activate_account(user_id):
     DAO.update(
         "UPDATE anaddventure.system_user SET system_user_is_valid_account = True WHERE system_user_id = (%s)",
         (user_id, ))
Beispiel #17
0
 def update_download_count(chapter_id):
     return DAO.update(
         "UPDATE anaddventure.chapter SET chapter_download_count = chapter_download_count + 1 WHERE chapter_id = (%s)",
         (chapter_id, ))