Ticket #16663: 16663-docs.patch

File 16663-docs.patch, 1.1 KB (added by Aymeric Augustin, 13 years ago)
  • docs/ref/models/fields.txt

     
    146146:meth:`~django.db.models.Model.get_FOO_display` in the database API
    147147documentation.
    148148
    149 Finally, note that choices can be any iterable object -- not necessarily a list
    150 or tuple. This lets you construct choices dynamically. But if you find yourself
    151 hacking :attr:`~Field.choices` to be dynamic, you're probably better off using a
    152 proper database table with a :class:`ForeignKey`. :attr:`~Field.choices` is
    153 meant for static data that doesn't change much, if ever.
     149Finally, note that choices can be any non-empty iterable object -- not
     150necessarily a list or tuple. This lets you construct choices dynamically. But if
     151you find yourself hacking :attr:`~Field.choices` to be dynamic, you're probably
     152better off using a proper database table with a :class:`ForeignKey`.
     153:attr:`~Field.choices` is meant for static data that doesn't change much, if
     154ever.
    154155
    155156``db_column``
    156157-------------
Back to Top