Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
ListField should enforce that input is a list#3513
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
ListField should enforce that input is a list#3513
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pattisdr commentedOct 16, 2015
I could include tuples and sets |
xordoquy commentedOct 16, 2015
Thanks for the path.
|
pattisdr commentedOct 16, 2015
You're right, I think excluding dictionaries from the ListField in addition to what was already in that line would do the trick. |
lovelydinosaur commentedOct 19, 2015
Agree - excluding dicts sounds like a good way around to do this. |
xordoquy commentedOct 19, 2015
Note: by dict we should read any mapping type. |
lovelydinosaur commentedOct 19, 2015
IDK - any chance that could be a bit fuzzy in cases we've not thought of? |
xordoquy commentedOct 19, 2015
Well, collections.Mapping should be a good base class to test against (as opposed to just dict). |
foresmac commentedOct 26, 2015
Probably want tests that prove this works as intended. |
xordoquy commentedNov 13, 2015
Yup, having tests would be great so we merge it. |
pattisdr commentedNov 16, 2015
Tests added. |
lovelydinosaur commentedNov 18, 2015
Looks good, thanks! |
…orce_listListField does not enforce that input is a list
Purpose
A dictionary is allowed as input in a ListField. If a dictionary is received as input, the keys of the object are retained, and the values are ignored. I assume the ListField should enforce that the input is an array, especially because the error message in
to_internal_valueincludes "not a list" if something is wrong with the data.Changes
Enforces that data cannot be a collections.Mapping.