本文整理汇总了Python中models.Member.number方法的典型用法代码示例。如果您正苦于以下问题:Python Member.number方法的具体用法?Python Member.number怎么用?Python Member.number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Member
的用法示例。
在下文中一共展示了Member.number方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import number [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: on_add_clicked
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import number [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,))
示例3: book_issue
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import number [as 别名]
def book_issue(self, member_number, book_barcode):
member = Member()
member.number = member_number
memberdboperation = getAdapter(member, IDbOperation)
member = memberdboperation.get()[0]
book = Book()
book.number = book_barcode
bookdboperation = getAdapter(book, IDbOperation)
book = bookdboperation.get()[0]
circulation = Circulation()
circulation.member = member
circulation.book = book
circulationdboperation = getAdapter(circulation, IDbOperation)
circulationdboperation.add()
示例4: initialize_lists
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import number [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)