本文整理汇总了Python中models.report_card.ReportCard.create方法的典型用法代码示例。如果您正苦于以下问题:Python ReportCard.create方法的具体用法?Python ReportCard.create怎么用?Python ReportCard.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.report_card.ReportCard
的用法示例。
在下文中一共展示了ReportCard.create方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_owner
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def add_owner(self, card_id):
if AppUser.for_user(users.get_current_user()).is_admin:
card = ReportCard.find_by_id(int(card_id))
card.owner_user_id.append(self.request.get('new_owner_id'))
card.put()
ReportCard.create(self.request.get('name'))
return webapp2.redirect_to('card-list')
示例2: test_add_owner
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def test_add_owner(self):
self.makeAdmin()
c = ReportCard.find_by_id(ReportCard.create(name='Add Owner Test Name').id())
self.assertEqual(1, len(c.owner_user_id))
response = self.testapp.post('/card/%d/add_owner' % c.key().id(), {'new_owner_id':'newowner'})
self.assertRedirect('/card/list$', response)
c = ReportCard.find_by_id(c.key().id())
self.assertEqual(2, len(c.owner_user_id))
示例3: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(SignatureHandlerTest, self).setUp()
self.card_id = ReportCard.create(name='Signature Test Card').id()
示例4: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(TextLineHandlerTest, self).setUp()
self.card_id = ReportCard.create(name='Category Test Card').id()
示例5: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(ItemHandlerTest, self).setUp()
self.card_id = ReportCard.create(name="Item Test Card").id()
self.category_id = EvalCategory.create("Item Test Category", self.card_id).id()
示例6: test_add_owner_form
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def test_add_owner_form(self):
self.makeAdmin()
c = ReportCard.create(name='Add Owner Form Test Name')
response = self.testapp.get('/card/%d/add_owner_form' % c.id())
self.assertSuccess(response)
示例7: test_preview
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def test_preview(self):
c = ReportCard.create(name='Preview Test Name')
response = self.testapp.get('/card/%d/preview' % c.id())
self.assertSuccess(response)
示例8: test_edit
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def test_edit(self):
c = ReportCard.create(name='Edit Test Name')
response = self.testapp.get('/card/%d/edit' % c.id())
self.assertSuccess(response)
示例9: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(CategoryHandlerTest, self).setUp()
self.card_id = ReportCard.create(name="Category Test Card").id()
示例10: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(EvalHandlerTest, self).setUp()
self.card_id = ReportCard.create(name='Eval Test Card').id()
示例11: setUp
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def setUp(self):
super(KeyLevelHandlerTest, self).setUp()
self.card_id = ReportCard.create(name='Key Level Test Card').id()
示例12: add
# 需要导入模块: from models.report_card import ReportCard [as 别名]
# 或者: from models.report_card.ReportCard import create [as 别名]
def add(self):
ReportCard.create(self.request.get('name'))
return webapp2.redirect_to('card-list')