Skip to content

Intro to Django Model Validators, Serializers, and Tests

What are we trying to accomplish?

By learning about Django Model field validators and Model Serializers from Django Rest Framework, you are aiming to build a robust and secure Django-based API. The knowledge of Model field validators enables you to ensure data integrity and consistency by defining validation rules directly within the model's fields, preventing invalid or inconsistent data from entering the database. Additionally, mastering Model Serializers allows you to efficiently transform complex data types, such as Django models, into JSON representations while handling serialization, deserialization, and validation effortlessly. Overall, this understanding empowers you to design and implement a well-structured API that efficiently manages data validation, serialization, and deserialization processes, enhancing both the user experience and the security of your application.

Lectures & Assignments

Lectures

Assignments

TLO's (Testable Learning Objectives)

  • Utilize Model Field Validators
  • Construct Django Model Serializers

ELO's (Enabling Learning Objectives)

  • Create Django Tests for Models
  • Understand Django Rest Frameworks
  • Create Custom Django Validators