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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin: add schema field to resource #2512
Admin: add schema field to resource #2512
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work 🌈
udata/core/dataset/models.py
Outdated
return [] | ||
|
||
r = requests.get(endpoint) | ||
r.raise_for_status() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a smarter caching strategy and exception handling.
Something like that https://github.com/etalab/udata-gouvfr/pull/486/files#diff-1c9abf3241dab91b0e60c554f8bcd67aR72.
This would lead to removing the cache on the API and handle it here.
No need to change that for now. I don't think we'll do anything very interesting with other schemas for quite some time. |
Thanks for your guidance and your help @abulte! I:
|
Added custom exceptions as you suggested @abulte. Thanks for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Alexandre Bulté <alexandre@bulte.net>
I had to do an extra commit this morning to fix I switched to a string field with a validator. The SelectField relies on a list of options, through the This pattern is used elsewhere in the very same file udata/udata/core/dataset/forms.py Lines 33 to 48 in 32b0903
|
I left some comments/questions at various places.
To discuss