-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/46 producttype nl api #23
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.
Generally looks good I think. Nothing is broken. The use of the exclude field is generally bad
From the default project:
Check that ModelForms use Meta.fields instead of Meta.exclude.
ModelForm.Meta.exclude is dangerous because it doesn't protect against
fields that are added later. Explicit white-listing is safer and prevents
bugs such as IMA #645.
Also a few questions and random remarks
Should be Changed (or can be changed quickly):
- Formatted translation might cause issues
- Use
self.get_queryset()
instead of the model - use
fields = (.....)
instead ofexclude = (.....)
==> easier to understand and removes unexpected fields - Reverses instead of hard coded URLS
Could Be Changed:
- Should use
self.client
get/post/patch/put instead ofBaseApiTestCase
methods - Test that fields are actually set on basic creation tests
- Perform database stuff after validation i.e. do not perform if not validated
- Related to the last: only test for errors if the field is not none
Minor Suggestions:
- Simple serializers not in the files matching their name
- Might want to move API to separate direction but that can probably wait or just not be done
router.py
should beurls.py
- using a nested router for
actuele-prijzen
I think? - (Some) validation can be moved to validators
- Could use DRF status enum
- Some better ordering in prijs update
I will not be here next week, so I cannot review changes for a while
Should be Changed (or can be changed quickly):
Could Be Changed:
Minor Suggestions: Simple serializers not in the files matching their name -> what to do about circular dependency?
|
) | ||
try: | ||
return super().destroy(request, *args, **kwargs) | ||
except ProtectedError: |
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.
Something that could come up in the future is something else being protected other than sub_themas
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.
Haven't looked fully at the tests but everything else seems fine
I wonder why thema was renamed? Also I think you broke migrations for people that have existing databases.
Changes
Notes