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