當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。