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


Python Member.name方法代码示例

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


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

示例1: get

# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import name [as 别名]
 def get(self):
     db = getUtility(IRelationalDatabase)
     cr = db.cursor()
     number = self.member.number
     if number:
         cr.execute("""SELECT
                         id,
                         number,
                         name
                       FROM members
                       WHERE number = ?""",
                    (number,))
     else:
         cr.execute("""SELECT
                         id,
                         number,
                         name
                       FROM members""")
     rst = cr.fetchall()
     cr.close()
     members = []
     for record in rst:
         id = record['id']
         number = record['number']
         name = record['name']
         member = Member()
         member.id = id
         member.number = number
         member.name = name
         members.append(member)
     return members
开发者ID:eugeneai,项目名称:ZCA,代码行数:33,代码来源:member.py

示例2: get

# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import name [as 别名]
	def get(self, args):
		if not require_admin(self):
			return
		
		template_vals = generate_base_template_vals(self)
		template_vals['title'] = 'Edit Member'
		template_vals['page'] = 'members'
		
		req_id = self.request.get('id')
		
		if not req_id:
			while True:
				# Create a new ID and verify it is unique.
				new_id = uuid4().hex
				if not Member.query(Member.id == new_id).get():
					new_member = Member()
					new_member.id = new_id
					new_member.name = 'New Member'
					template_vals['member'] = new_member
					break
		else:
			member = Member.query(Member.id == req_id).get()
			if member:
				template_vals['member'] = member
			else:
				self.error(404)
				return
		
		template_vals['semesters'] = get_all_semesters()
		
		template = JINJA_ENVIRONMENT.get_template('member_edit.html')
		self.response.write(template.render(template_vals))
开发者ID:zmyaro,项目名称:star-site,代码行数:34,代码来源:members.py

示例3: on_add_clicked

# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import name [as 别名]
 def on_add_clicked(self, *args):
     number = self.ui.number.get_text()
     name = self.ui.name.get_text()
     member = Member()
     member.number = number
     member.name = name
     self.add(member)
     self.ui.list_store.append((member, number, name,))
开发者ID:eugeneai,项目名称:ZCA,代码行数:10,代码来源:vc.py

示例4: create

# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import name [as 别名]
 def create(self):
     """Creates and returns a new member"""
     member = MemberModel()
     name = input("Name: ")
     personal_number = self._read_personal_number("Pesonal Number:")
     member.name = name
     member.personal_number = personal_number
     self.display(member)
     if not self._read_binary("Is this correct?"):
         self.edit(member)
     return member
开发者ID:rk222ev,项目名称:1dv607_Member_registry,代码行数:13,代码来源:member.py

示例5: initialize_lists

# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import name [as 别名]
    def initialize_lists(self):
        cm=Gtk.ListStore(object, str, str, str)
        self.ui.catalog=cm
        self.ui.catalog_view.set_model(cm)
        for _ in range(3):
            b=Book()
            b.title="Brotherhood of the ring"
            b.author="J.R.R.Tolkien"
            b.barcode="123-1232"
            self.append_book(b)

        mm=Gtk.ListStore(object, int, str)
        self.ui.members=mm
        self.ui.member_view.set_model(mm)
        for _ in range(3):
            m=Member()
            m.name="Jim Carry"
            m.number=123
            self.append_member(m)
开发者ID:eugeneai,项目名称:ZCA,代码行数:21,代码来源:vc.py


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