Forem

Matt Layman
Matt Layman

Posted on • Originally published at mattlayman.com

1

Give Me A Break... Day - Building SaaS #67

In this episode, we did some Django model development. I created a new model to track break days in a school year. This model will be critical to fill in vacations and holidays so that the scheduling functionality works properly. I added the model, the tests, the admin page, and the create view to create break days in the app.

We started by picking a model name and discussing naming in programming. I used test-driven development (TDD) to build the model that I named SchoolBreak. We created a model factory to build out the full model class. I added attributes for the day, a description, a foreign key to a SchoolYear, and a UUID.

After working on the model, I started working on the CRUD interfaces for the SchoolBreak. We created a button to get to the create page on the school year page.

Once the button was complete, I added a SchoolBreakCreateView that followed a very similar pattern as the GradeLevelCreateView. We worked through all the tests to ensure that the new view behaves properly.

Finally, I made a Django admin so I could view school breaks. With the admin in place, I could use the create view and verify that I created an actual break record in the database.

On future streams, we will work on hooking up the remaining parts of CRUD and add the ability to read, update, and delete school breaks.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (1)

Collapse
 
gravesli profile image
gravesli

I think you are great! i just want to discuss tech with Python developer.
I built a display machine state using Python3 with Flask!
Flask State Github:github.com/yoobool/flask-state
Should i can get some improvement suggestions from you? Thanks~

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay