Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Limits the number of related items added to the choices dictionary on RelatedField#3330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lovelydinosaur commentedAug 25, 2015
As presented I think this would actually break the An alternative might be a |
rubendura commentedAug 25, 2015
It seems to be working fine on my side with a dropdown using html_cutoff, but I haven't tested other cases yet. I'm not sure what you mean with the last paragraph. Why would you want to call that get_choices() with different cutoffs? |
lovelydinosaur commentedAug 25, 2015
What I mean is I'm not totally comfortable with '.choices' always being hard-limited. (Tho its possible I could be convinced to change my mind on that) |
…ons to limit the amount of choices
rubendura commentedAug 25, 2015
I guess that by doing this we keep the current RelatedField.choices behaviour while allowing iter_options to limit how many choices we have. I know this is lacking tests and we should probably have some for it. I might look into it later. |
lovelydinosaur commentedAug 25, 2015
Looks about right, yeah. |
vstoykov commentedSep 7, 2015
I also have problems with RelatedField to table with many records. OPTIONS response can be delay to 1 minute which is not good. I also thought about proper solution for this problem and I don't think that limiting
Probably we need an argument for that field that will mark the field as "raw_id" like in the django admin. And for this field there will be no select in the HTML view and there will be no What you think about that? |
lovelydinosaur commentedSep 7, 2015
I think what we present in |
jathanism commentedOct 2, 2015
I would like to add that I am encountering this issue in my own server (with about 220k related records for a field) which utterly crushes the app. I tested the patch above and it's working for me. You also have my vote for removing the enumeration of related choices in |
lovelydinosaur commentedJan 27, 2016
Probably a good plan. |
wimglenn commentedFeb 22, 2016
+1 choices enumeration in an OPTIONS request is making the response HUGE, and the browsable API unusable for me in 3.3.2 |
wimglenn commentedAug 10, 2016
Thanks! 👍 |
lovelydinosaur commentedAug 10, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Most welcome. Pleasure to get the triage back on track now that we're (mostly) funded! 😎 |
Refs#3329
Solves a memory issue when evaluating very large querysets