當前位置: 首頁>>代碼示例>>Python>>正文


Python DataLinker.set_data_attributes方法代碼示例

本文整理匯總了Python中dNG.data.data_linker.DataLinker.set_data_attributes方法的典型用法代碼示例。如果您正苦於以下問題:Python DataLinker.set_data_attributes方法的具體用法?Python DataLinker.set_data_attributes怎麽用?Python DataLinker.set_data_attributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dNG.data.data_linker.DataLinker的用法示例。


在下文中一共展示了DataLinker.set_data_attributes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: set_data_attributes

# 需要導入模塊: from dNG.data.data_linker import DataLinker [as 別名]
# 或者: from dNG.data.data_linker.DataLinker import set_data_attributes [as 別名]
	def set_data_attributes(self, **kwargs):
	#
		"""
Sets values given as keyword arguments to this method.

:since: v0.1.00
		"""

		with self, self.local.connection.no_autoflush:
		#
			DataLinker.set_data_attributes(self, **kwargs)

			if ("owner_type" in kwargs): self.local.db_instance.owner_type = kwargs['owner_type']
			if ("author_id" in kwargs): self.local.db_instance.author_id = kwargs['author_id']
			if ("author_ip" in kwargs): self.local.db_instance.author_ip = kwargs['author_ip']
			if ("time_published" in kwargs): self.local.db_instance.time_published = int(kwargs['time_published'])
			if ("preserve_space" in kwargs): self.local.db_instance.preserve_space = kwargs['preserve_space']
			if ("locked" in kwargs): self.local.db_instance.locked = kwargs['locked']
			if ("guest_permission" in kwargs): self.local.db_instance.guest_permission = kwargs['guest_permission']
			if ("user_permission" in kwargs): self.local.db_instance.user_permission = kwargs['user_permission']

			if ("content" in kwargs):
			#
				if (self.local.db_instance.rel_text_entry is None):
				#
					self.local.db_instance.rel_text_entry = _DbTextEntry()
					self.local.db_instance.rel_text_entry.id = self.local.db_instance.id
					db_text_entry = self.local.db_instance.rel_text_entry
				#
				else: db_text_entry = self.local.db_instance.rel_text_entry

				db_text_entry.content = Binary.utf8(kwargs['content'])
開發者ID:dNG-git,項目名稱:pas_discuss,代碼行數:34,代碼來源:post.py

示例2: set_data_attributes

# 需要導入模塊: from dNG.data.data_linker import DataLinker [as 別名]
# 或者: from dNG.data.data_linker.DataLinker import set_data_attributes [as 別名]
    def set_data_attributes(self, **kwargs):
        """
Sets values given as keyword arguments to this method.

:since: v0.2.00
        """

        with self:
            DataLinker.set_data_attributes(self, **kwargs)

            if ("id_subscription" in kwargs): self.local.db_instance.id_subscription = Binary.utf8(kwargs['id_subscription'])
            if ("entry_type" in kwargs): self.local.db_instance.entry_type = kwargs['entry_type']
            if ("owner_type" in kwargs): self.local.db_instance.owner_type = kwargs['owner_type']
            if ("locked" in kwargs): self.local.db_instance.locked = kwargs['locked']
            if ("guest_permission" in kwargs): self.local.db_instance.guest_permission = kwargs['guest_permission']
            if ("user_permission" in kwargs): self.local.db_instance.user_permission = kwargs['user_permission']
開發者ID:dNG-git,項目名稱:pas_contentor,代碼行數:18,代碼來源:category.py

示例3: set_data_attributes

# 需要導入模塊: from dNG.data.data_linker import DataLinker [as 別名]
# 或者: from dNG.data.data_linker.DataLinker import set_data_attributes [as 別名]
	def set_data_attributes(self, **kwargs):
	#
		"""
Sets values given as keyword arguments to this method.

:since: v0.1.00
		"""

		with self:
		#
			DataLinker.set_data_attributes(self, **kwargs)

			if ("id_subscription" in kwargs): self.local.db_instance.id_subscription = Binary.utf8(kwargs['id_subscription'])
			if ("hybrid_list" in kwargs): self.local.db_instance.hybrid_list = kwargs['hybrid_list']
			if ("owner_type" in kwargs): self.local.db_instance.owner_type = kwargs['owner_type']
			if ("description" in kwargs): self.local.db_instance.description = Binary.utf8(kwargs['description'])

			if ("topics" in kwargs):
			#
				if (kwargs['topics'] == "++"): self.local.db_instance.topics = self.local.db_instance.topics + 1
				elif (kwargs['topics'] == "--"):
				#
					if (self.local.db_instance.topics > 0): self.local.db_instance.topics = self.local.db_instance.topics - 1
				#
				else: self.local.db_instance.topics = kwargs['topics']
			#

			if ("posts" in kwargs):
			#
				if (kwargs['posts'] == "++"): self.local.db_instance.posts = self.local.db_instance.posts + 1
				elif (kwargs['posts'] == "--"):
				#
					if (self.local.db_instance.posts > 0): self.local.db_instance.posts = self.local.db_instance.posts - 1
				#
				else: self.local.db_instance.posts = kwargs['posts']
			#

			if ("last_id_topic" in kwargs): self.local.db_instance.last_id_topic = kwargs['last_id_topic']
			if ("last_id_author" in kwargs): self.local.db_instance.last_id_author = kwargs['last_id_author']
			if ("last_preview" in kwargs): self.local.db_instance.last_preview = Binary.utf8(kwargs['last_preview'])
			if ("locked" in kwargs): self.local.db_instance.locked = kwargs['locked']
			if ("guest_permission" in kwargs): self.local.db_instance.guest_permission = kwargs['guest_permission']
			if ("user_permission" in kwargs): self.local.db_instance.user_permission = kwargs['user_permission']
開發者ID:dNG-git,項目名稱:pas_discuss,代碼行數:45,代碼來源:list.py

示例4: set_data_attributes

# 需要導入模塊: from dNG.data.data_linker import DataLinker [as 別名]
# 或者: from dNG.data.data_linker.DataLinker import set_data_attributes [as 別名]
    def set_data_attributes(self, **kwargs):
        """
Sets values given as keyword arguments to this method.

:since: v0.1.00
        """

        with self, self.local.connection.no_autoflush:
            DataLinker.set_data_attributes(self, **kwargs)

            if ("vfs_url" in kwargs): self.local.db_instance.vfs_url = Binary.utf8(kwargs['vfs_url'])
            if ("vfs_type" in kwargs): self.local.db_instance.vfs_type = kwargs['vfs_type']
            if ("role_id" in kwargs): self.local.db_instance.role_id = Binary.utf8(kwargs['role_id'])
            if ("owner_type" in kwargs): self.local.db_instance.owner_type = kwargs['owner_type']
            if ("owner_id" in kwargs): self.local.db_instance.owner_id = kwargs['owner_id']
            if ("owner_ip" in kwargs): self.local.db_instance.owner_ip = kwargs['owner_ip']
            if ("mimeclass" in kwargs): self.local.db_instance.mimeclass = kwargs['mimeclass']
            if ("mimetype" in kwargs): self.local.db_instance.mimetype = kwargs['mimetype']
            if ("size" in kwargs): self.local.db_instance.size = kwargs['size']
            if ("locked" in kwargs): self.local.db_instance.locked = kwargs['locked']
            if ("guest_permission" in kwargs): self.local.db_instance.guest_permission = kwargs['guest_permission']
            if ("user_permission" in kwargs): self.local.db_instance.user_permission = kwargs['user_permission']
開發者ID:dNG-git,項目名稱:pas_file_center,代碼行數:24,代碼來源:entry.py


注:本文中的dNG.data.data_linker.DataLinker.set_data_attributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。