Structural patterns

This section contains several design patterns that can help you design and structure your models.

Patterns – normalized models

Problem: By design, model instances have duplicated data that cause data inconsistencies.

Solution: Break down your models into smaller models through normalization. Connect these models with logical relationships between them.

Problem details

Imagine if someone designed our Post table (omitting certain columns) in the following way:

Superhero Name

Message

Posted on

Captain Temper

Has this posted yet?

2012/07/07 07:15

Professor English

It should be 'Is' not 'Has'.

2012/07/07 07:17

Captain Temper

Has this posted yet?

2012/07/07 07:18

Capt. Temper

Has this posted yet?

2012/07/07 07:19

I hope ...

Get Django Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.