本文整理汇总了Python中models.Member.create_table方法的典型用法代码示例。如果您正苦于以下问题:Python Member.create_table方法的具体用法?Python Member.create_table怎么用?Python Member.create_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Member
的用法示例。
在下文中一共展示了Member.create_table方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_user
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import create_table [as 别名]
def add_user():
# dummy user and dummy member are created on first request.
# user is responsible for creating dummy events.
Event.create_table(fail_silently=True)
Member.create_table(fail_silently=True)
Minute.create_table(fail_silently=True)
Picture.create_table(fail_silently=True)
User.create_table(fail_silently=True)
#
# # create a dummy member
# try:
# member = Member(first_name="Bryan",
# last_name="Bennett",
# collegiate_chapter="Zeta Omicron "
# "(Georgia Southern University)",
# initiation_date=datetime.date(2006, 04, 06),
# office="Secretary, Warden",
# image_path="Bryan_Bennett.jpg")
# member.save()
# except IntegrityError as e:
# print e
#
# create a dummy user
try:
admin = User(username='bbenne10', email='[email protected]',
admin=True, active=True)
admin.set_password("password")
admin.save()
except IntegrityError as e:
print e