本文整理汇总了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'])
示例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']
示例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']
示例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']