03.09.2020       Выпуск 350 (31.08.2020 - 06.09.2020)       Вопросы и обсуждения

Custom Form Validation - Building SaaS #71



Экспериментальная функция:

Ниже вы видите текст статьи по ссылке. По нему можно быстро понять ссылка достойна прочтения или нет

Просим обратить внимание, что текст по ссылке и здесь может не совпадать.


In this episode, I added some custom checking to ensure that students may only be enrolled in a single grade level for a school year. We talked about form cleaning and wrote a for unit test to prove that the change worked. After that change, we switched to a template and wrote copy for when no progress reports are viewable for users.

With the first issue, I needed to update a form that enrolls students. I wanted to ensure that students can’t be enrolled in more than one grade level in a single school year. I updated the clean method of the EnrollmentForm to check that no other enrollments exist for the school year.

We added a new test case and created a test to check that the form change was correct.

With that change done, we moved onto template work. The reports index page has nothing valuable to show until certain data exists in the system. To provide something visual when that data doesn’t exist, we added an empty page so that new users won’t see a blank page.

Разместим вашу рекламу

Пиши: mail@pythondigest.ru

Нашли опечатку?

Выделите фрагмент и отправьте нажатием Ctrl+Enter.

Система Orphus