Ticket #8705: indentation_modelstxt.diff

File indentation_modelstxt.diff, 2.6 KB (added by Horst Gutmann <zerok@…>, 7 years ago)
  • docs/topics/db/models.txt

    diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt
    index e22660a..a691dbc 100644
    a b optional. They're fully explained in the :ref:`reference 
    143143ones:
    144144
    145145    :attr:`~Field.null`
    146 
    147146        If ``True``, Django will store empty values as ``NULL`` in the database.
    148147        Default is ``False``.
    149 
     148       
    150149    :attr:`~Field.blank`
    151 
    152150        If ``True``, the field is allowed to be blank. Default is ``False``.
    153    
     151       
    154152        Note that this is different than :attr:`~Field.null`.
    155153        :attr:`~Field.null` is purely database-related, whereas
    156154        :attr:`~Field.blank` is validation-related. If a field has
    157155        :attr:`blank=True <Field.blank>`, validation on Django's admin site will
    158156        allow entry of an empty value. If a field has :attr:`blank=False
    159157        <Field.blank>`, the field will be required.
    160 
     158       
    161159    :attr:`~Field.choices`
    162 
    163160        An iterable (e.g., a list or tuple) of 2-tuples to use as choices for
    164161        this field. If this is given, Django's admin will use a select box
    165162        instead of the standard text field and will limit choices to the choices
    166163        given.
    167 
     164       
    168165        A choices list looks like this::
    169 
     166       
    170167            YEAR_IN_SCHOOL_CHOICES = (
    171168                ('FR', 'Freshman'),
    172169                ('SO', 'Sophomore'),
    ones: 
    176173            )
    177174           
    178175    :attr:`~Field.default`
    179 
    180176        The default value for the field. This can be a value or a callable
    181177        object. If callable it will be called every time a new object is
    182178        created.
    183    
     179       
    184180    :attr:`~Field.help_text`
    185 
    186181        Extra "help" text to be displayed under the field on the object's admin
    187182        form. It's useful for documentation even if your object doesn't have an
    188183        admin form.
    189 
     184       
    190185    :attr:`~Field.primary_key`
    191 
    192186        If ``True``, this field is the primary key for the model.
    193 
     187       
    194188        If you don't specify :attr:`primary_key=True <Field.primary_key>` for
    195189        any fields in your model, Django will automatically add an
    196190        :class:`IntegerField` to hold the primary key, so you don't need to set
    197191        :attr:`primary_key=True <Field.primary_key>` on any of your fields
    198192        unless you want to override the default primary-key behavior. For more,
    199193        see :ref:`automatic-primary-key-fields`.
    200 
     194       
    201195    :attr:`~Field.unique`
    202 
    203196        If ``True``, this field must be unique throughout the table.
    204197
    205198Again, these are just short descriptions of the most common field options. Full
Back to Top