Blueprint App
The _blueprint app is a template app used by suit_model to generate CRUD code for your models.
How it works
suit_model reads Python source files from apps/_blueprint/ and applies string replacements (model name, field names, URL names) to produce working CRUD code for your model.
Included Blueprints
Blueprint |
Purpose |
FK support |
|---|---|---|
|
Table layout for simple models |
No |
|
Table layout for models with a ForeignKey |
Yes |
|
Card layout for simple models |
No |
|
Card layout for models with a ForeignKey |
Yes |
|
Table View class (CBV) |
No |
|
Cards View class (CBV) |
No |
|
Table View with FK context handling |
Yes |
|
Cards View with FK context handling |
Yes |
|
ModelForm for simple models |
No |
|
ModelForm including FK field |
Yes |
|
DRF ModelSerializer |
Both |
|
Factory Boy factory |
Both |
|
Test suite for table layout |
No |
|
Test suite for cards layout |
No |
|
Test suite for table with FK |
Yes |
|
Test suite for cards with FK |
Yes |
|
Initial migration with both |
- |
Browsing the Blueprint App
After running the project, these URLs let you see the blueprint views working live:
http://localhost:8000/blueprint/table/
http://localhost:8000/blueprint/cards/
Customizing Blueprints
You can modify any file in apps/_blueprint/ to change how suit_model generates code for all future models. The blueprint files use placeholder identifiers like:
BlueprintSimpleModel→ replaced with your model name['name', 'description']→ replaced with your model’s field list_blueprint:table→ replaced with your app’s URL name