コード例 #1
0
ファイル: test_question.py プロジェクト: igor-calic/poll
    def test_sort_order(self):
        Question.create(text="This is question 1", order=2)
        Question.create(text="This is question 2", order=1)

        questions = Question.all()

        self.assertEquals(1, questions[0].order)
        self.assertEquals(2, questions[1].order)
コード例 #2
0
ファイル: questions.py プロジェクト: igor-calic/poll
 def api_all_questions(self):
     self.context['data'] = Question.all()
コード例 #3
0
 def api_all_questions(self):
     self.context['data'] = Question.all()