diff --git a/chapters/introduction.tex b/chapters/introduction.tex index ecc7a10..bd3dd5d 100755 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -99,6 +99,7 @@ Il ne sera pas possible de toutes les détailler; faites un tour sur \item \url{https://stackoverflow.com}, \item \url{https://ycombinator.com}, \item \url{https://lobste.rs/}, + \item \url{https://semaphoreci.com/blog}, \item \url{https://lecourrierduhacker.com/} \item ou \url{https://www.djangoproject.com/}. \end{itemize} diff --git a/chapters/models.tex b/chapters/models.tex index f553a0b..31ea042 100755 --- a/chapters/models.tex +++ b/chapters/models.tex @@ -241,6 +241,13 @@ class Book(models.Model): Notre code d'initialisation reste par contre identique: Django s'occupe parfaitement de gérer la transition. +\begin{memorizebox} +Lorsque nous avons une relation de type \texttt{A -> B <- C}, avec des \# de 1 à N, l'intérêt sera surtout de pouvoir définir un lien \texttt{N-N} entre les tables \texttt{A} et \texttt{C} (et donc, une classe de liaison, avec ses propres champs). +Attention qu'il faudra malgré tout sauver les instances de type \texttt{A} et \texttt{C} avant de pouvoir sauver une instance de {B}. +De la même manière, si vous souhaitez accéder aux champs de \texttt{B}, il ne sera pas possible de le faire en partant de \texttt{A} ou \texttt{C}. +Il conviendra également de spécifier l'attribut \texttt{through\_fields}, afin de mettre cette abstraction en place. +\end{memorizebox} + \section{Shell} Le \texttt{shell} est un environnement REPL \index{REPL} identique à ce que l'interpréteur Python offre par défaut, connecté à la base de données, qui permet de : diff --git a/chapters/templates.tex b/chapters/templates.tex index d49126f..4b3191e 100755 --- a/chapters/templates.tex +++ b/chapters/templates.tex @@ -259,10 +259,10 @@ Voir ici https://github.com/spookylukey/django-htmx-patterns https://www.mattlayman.com/blog/2021/how-to-htmx-django/ https://github.com/spookylukey/django-htmx-patterns/blob/master/approach.rst -https://github.com/spookylukey/django-htmx-patterns/blob/master/base_template.rst +https://github.com/spookylukey/django-htmx-patterns/blob/master/base\_template.rst https://github.com/spookylukey/django-htmx-patterns/blob/master/headers.rst https://github.com/spookylukey/django-htmx-patterns/blob/master/posts.rst -https://github.com/spookylukey/django-htmx-patterns/blob/master/separate_partials.rst -https://github.com/spookylukey/django-htmx-patterns/blob/master/separate_partials_single_view.rst -https://github.com/spookylukey/django-htmx-patterns/blob/master/inline_partials.rst +https://github.com/spookylukey/django-htmx-patterns/blob/master/separate\_partials.rst +https://github.com/spookylukey/django-htmx-patterns/blob/master/separate\_partials\_single\_view.rst +https://github.com/spookylukey/django-htmx-patterns/blob/master/inline\_partials.rst