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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user