{% extends 'base.html' %} {% load static %} {% load bootstrap4 %} {% load base_extras %} {% block head-extra %} {% endblock %} {% block content %} {% if root %}
{{root}}
population script
get_or_create
method asks the database if this entry already exists.
If not the entry is written to the databse.
Alternatives are, e.g., object instanciation (no write to the database), create
or get
.
See also the Django docs.
ForeignKey
s are python objects.
For convienince this script creates objects in the right order and you just have to include them at the approriate place (indicated by their name).
id
s (see the Django docs).