Sankofa Journal Step 5: The Models

Write the models: Post, Category and Tag, with an author linked to Django's User. Decide on_delete for each relationship deliberately and write a one-line comment saying why you chose it, because that reasoning is invisible in the code otherwise. Give Post a __str__, a Meta with an ordering, and a get_absolute_url that uses the route name from module 2. Do not run makemigrations yet: read the models once more first and check that every field's type, default and blank setting is what you actually meant.

SANKOFA SANDBOX
loading editor…
Your turn → Work through it step by step. This is a piece of the course project, not a throwaway exercise.

Built it in both languages?

Mark it done once your Python and JavaScript versions both run correctly. Honesty here is what makes the dashboard useful to you.

← BackNext: Module 6: Migrations and the Database →