The default behavior is to render a <select> element containing ''every''
instance of the model referred to by the FK.
When this field refers to a model that has for example, 100,000 or more
entries, this can have the affect of crashing a server, a browser, or at
best making new users confused about why they cannot view the admin page
for this instance.
Defaulting to raw_id is safer and more reliable in most cases and presents
minimal compromises in usability (in my opinion).
--
Ticket URL: <https://code.djangoproject.com/ticket/25114>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> Foreign key fields in the admin currently default to a behavior that can
> cause crashing and user inconvenience.
>
> The default behavior is to render a <select> element containing ''every''
> instance of the model referred to by the FK.
>
> When this field refers to a model that has for example, 100,000 or more
> entries, this can have the affect of crashing a server, a browser, or at
> best making new users confused about why they cannot view the admin page
> for this instance.
>
> Defaulting to raw_id is safer and more reliable in most cases and
> presents minimal compromises in usability (in my opinion).
New description:
Foreign key fields in the admin currently default to a behavior that can
cause crashes and user inconvenience.
The default behavior is to render a <select> element containing ''every''
instance of the model referred to by the FK.
When this field refers to a model that has for example, 100,000 or more
entries, this can have the affect of crashing a server, a browser, or at
best making new users confused about why they cannot view the admin page
for this instance.
Defaulting to raw_id is safer and more reliable in most cases and presents
minimal compromises in usability (in my opinion).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:1>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
I don't think the justification is strong enough to warrant a backwards
incompatible change here (i.e. every Django project would have to switch
from opting-in to `raw_id_fields` to opting-out), but feel free to open a
discussion on the DevelopersMailingList if you want to try to get a
consensus otherwise.
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:3>
Old description:
> Foreign key fields in the admin currently default to a behavior that can
> cause crashes and user inconvenience.
>
> The default behavior is to render a <select> element containing ''every''
> instance of the model referred to by the FK.
>
> When this field refers to a model that has for example, 100,000 or more
> entries, this can have the affect of crashing a server, a browser, or at
> best making new users confused about why they cannot view the admin page
> for this instance.
>
> Defaulting to raw_id is safer and more reliable in most cases and
> presents minimal compromises in usability (in my opinion).
New description:
Foreign key fields in the admin currently default to a behavior that can
cause crashes and user inconvenience.
The default behavior is to render a <select> element containing ''every''
instance of the model referred to by the FK.
When this field refers to a model that has for example, 100,000 or more
entries, this can have the affect of crashing a server, a browser, or at
best making new users confused about why they cannot view the admin page
for this instance.
A get_raw_id_fields method that enables
--
Comment (by vepkenez):
You are totally right about this. I was just here to propose an alternate
solution to this but I will start a discussion on the dev mailing list.
something like this...
{{{
def get_raw_id_fields(self):
"""
Hook for overriding default raw_id_fields behavior
"""
return self.raw_id_fields
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:4>
Comment (by timgraham):
There's an open ticket about adding `get_raw_id_fields()`: #17881.
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:5>
Comment (by vepkenez):
so sorry. I really did look for this!
Ok great!
--
Ticket URL: <https://code.djangoproject.com/ticket/25114#comment:6>