mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Removed unnecessary code-block directives.
This commit is contained in:
parent
fa02120d36
commit
9d6551204e
32 changed files with 161 additions and 308 deletions
|
@ -2,11 +2,7 @@
|
|||
Many-to-one relationships
|
||||
#########################
|
||||
|
||||
.. highlight:: pycon
|
||||
|
||||
To define a many-to-one relationship, use :class:`~django.db.models.ForeignKey`.
|
||||
|
||||
.. code-block:: python
|
||||
To define a many-to-one relationship, use :class:`~django.db.models.ForeignKey`::
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
@ -32,6 +28,8 @@ To define a many-to-one relationship, use :class:`~django.db.models.ForeignKey`.
|
|||
What follows are examples of operations that can be performed using the Python
|
||||
API facilities.
|
||||
|
||||
.. highlight:: pycon
|
||||
|
||||
Create a few Reporters::
|
||||
|
||||
>>> r = Reporter(first_name='John', last_name='Smith', email='john@example.com')
|
||||
|
|
|
@ -2,13 +2,9 @@
|
|||
One-to-one relationships
|
||||
########################
|
||||
|
||||
.. highlight:: pycon
|
||||
|
||||
To define a one-to-one relationship, use :ref:`ref-onetoone`.
|
||||
|
||||
In this example, a ``Place`` optionally can be a ``Restaurant``:
|
||||
|
||||
.. code-block:: python
|
||||
In this example, a ``Place`` optionally can be a ``Restaurant``::
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
@ -37,6 +33,8 @@ In this example, a ``Place`` optionally can be a ``Restaurant``:
|
|||
What follows are examples of operations that can be performed using the Python
|
||||
API facilities.
|
||||
|
||||
.. highlight:: pycon
|
||||
|
||||
Create a couple of Places::
|
||||
|
||||
>>> p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue