1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[5.0.x] Corrected code-block directives in docs.

Backport of 0be6dde817 from main
This commit is contained in:
Mariusz Felisiak
2023-12-28 19:52:15 +01:00
parent 454269b2e1
commit f33eddff8a
4 changed files with 14 additions and 17 deletions

View File

@@ -252,7 +252,7 @@ model:
This command should produce the following output:
.. console::
.. code-block:: sql
BEGIN;
--
@@ -686,12 +686,13 @@ __ https://spatialreference.org/ref/epsg/32140/
.. code-block:: pycon
from django.db import connection
# or if you're querying a non-default database:
from django.db import connections
connection = connections['your_gis_db_alias']
City.objects.raw('SELECT id, name, %s as point from myapp_city' % (connection.ops.select % 'point'))
>>> from django.db import connection
>>> # or if you're querying a non-default database:
>>> from django.db import connections
>>> connection = connections["your_gis_db_alias"]
>>> City.objects.raw(
... "SELECT id, name, %s as point from myapp_city" % (connection.ops.select % "point")
... )
You should only use raw queries when you know exactly what you're doing.