mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Deprecated SortedDict (replaced with collections.OrderedDict)
Thanks Loic Bistuer for the review.
This commit is contained in:
parent
b278f7478d
commit
07876cf02b
26 changed files with 139 additions and 107 deletions
|
@ -977,14 +977,13 @@ of the arguments is required, but you should use at least one of them.
|
|||
``select_params`` parameter. Since ``select_params`` is a sequence and
|
||||
the ``select`` attribute is a dictionary, some care is required so that
|
||||
the parameters are matched up correctly with the extra select pieces.
|
||||
In this situation, you should use a
|
||||
:class:`django.utils.datastructures.SortedDict` for the ``select``
|
||||
value, not just a normal Python dictionary.
|
||||
In this situation, you should use a :class:`collections.OrderedDict` for
|
||||
the ``select`` value, not just a normal Python dictionary.
|
||||
|
||||
This will work, for example::
|
||||
|
||||
Blog.objects.extra(
|
||||
select=SortedDict([('a', '%s'), ('b', '%s')]),
|
||||
select=OrderedDict([('a', '%s'), ('b', '%s')]),
|
||||
select_params=('one', 'two'))
|
||||
|
||||
The only thing to be careful about when using select parameters in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue