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


Python ReportCard.create方法代码示例

本文整理汇总了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')
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:9,代码来源:card_handler.py

示例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))
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:10,代码来源:card_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:signature_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:text_line_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:6,代码来源:item_handler_test.py

示例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)
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:7,代码来源:card_handler_test.py

示例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)
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:6,代码来源:card_handler_test.py

示例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)
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:6,代码来源:card_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:category_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:eval_handler_test.py

示例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()
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:key_handler_test.py

示例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')
开发者ID:emanderson,项目名称:preschool-report-card,代码行数:5,代码来源:card_handler.py


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