mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-12-14 09:57:38 +00:00
Documn. fix
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
|
||||
<h3 id="3sent">Three sentence intro to Django for python programmers</h3>
|
||||
<ul>
|
||||
<li>There are many 'magic' function calls autogenerated. So when we create a <var>'Cave'</var> class (subclass of Django <var>Model</var>), with an instance <var>'caveenetrance'</var> we automagically define functions such as:
|
||||
<li>There are many 'magic' function calls autogenerated. So when we create an object of <var>'Cave'</var> class (subclass of Django <var>Model</var>), with a property (foreign key) which is an instance of the CaveAndEntrance class, we automagically define functions such as:
|
||||
<ul>
|
||||
<li><var>Cave.objects.filter()</var>
|
||||
<li><var>Cave.objects.all()</var>
|
||||
<li><var>Cave.caveandentrance_set.all</var>
|
||||
</ul>
|
||||
note that the suffix on a name '<var>'_set</var> actually denotes a function call to the database on an object of class "CaveAndEntrance". Don't let this upset you. (The underline character and lower-casing denotes a dereferencing operation in Django queries.)
|
||||
note that the suffix on a name '<var>'_set</var> 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 denotes a dereferencing operation in Django queries.)
|
||||
|
||||
<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.
|
||||
|
||||
@@ -64,6 +64,9 @@ href="https://docs.djangoproject.com/en/dev/misc/design-philosophies/">loosely c
|
||||
is important: it is a key reason why we need a framework and not just a mess of javascript. We have nearly 100 URL patterns.
|
||||
We should try to reduce the number of distinct URLs perhaps, but they help document the structure too.
|
||||
|
||||
<h4>Other Cambridge student societies use Django</h4>
|
||||
<p>CUYC, the yacht sailing club, has a website system 3-4x bigger than troggle which is used for booking weekly sailing trips and handles all their money and certification records. It is plugged (live) into PayPal. They have a turnover of over £50,000 a year. We don't know of other societies in this league (yet), but Django skills are not rare in Cambridge.
|
||||
|
||||
<h4 id="coding">More django coding tricks</h4>
|
||||
<p>[This section, and the <a href="#3sent">3-sentence intro</a>, to go to another page ?]
|
||||
<p>Much of our coding is still stuck in the early Django v1 era, before 2011. So many idioms in the code are not the best way of doing things these days. In particular there are powerful query optimisations now available that none of our code uses (yet):
|
||||
|
||||
Reference in New Issue
Block a user