_set - online edit of handbook/troggle/trogdjango.html

This commit is contained in:
Philip Sargent at home
2024-12-31 07:23:31 +00:00
committed by Expo on server
parent be9e40cf2d
commit df7dff844b

View File

@@ -22,7 +22,7 @@
<li><var>Cave.objects.all()</var>
<li><var>Cave.caveandentrance_set.all</var>
</ul>
note that the suffix on a name '<a href="https://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects"><var>_set</var></a>' actually denotes a function call to the database to find all objects of class "CaveAndEntrance" which are foreign-keyed on that object "Cave". Don't let this upset you. Yes, at a deeper level there is SQL happening. (The underline character and lower-casing usually denotes a dereferencing operation in Django queries, but in this case it is a
note that the suffix on a name '<a href="https://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects"><var>_set</var></a>' actually denotes a function call to the database to find all objects of class "CaveAndEntrance" <a href="https://dnmtechs.com/understanding-the-_set-attribute-in-django-querysets/">which are foreign-keyed</a> on that object "Cave". Don't let this upset you. Yes, at a deeper level there is SQL happening. (The underline character and lower-casing usually denotes a dereferencing operation in Django queries, but in this case it is a
<a href="https://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects">backwards relation</a>, but we don't do anything that devious in troggle.)
<li>You will get very familiar with the <a href="https://docs.djangoproject.com/en/3.2/">online documentation</a>. be sure to be looking that the flavour for the right release of Django (indicated on the bottom-right of the screen: the link here goes to v3.2). You can read it in Polish, Indonesian, Brazilian-Portuguese or whatever if you prefer.