fields.py and corresponding tests have entered bloatware status #7896
Unanswered
hugocartwright
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
Could the last 3 classes of generics.py be simplified to the following? (passes all tests) class RetrieveUpdateAPIView(RetrieveAPIView, UpdateAPIView):
"""
Concrete view for retrieving, updating a model instance.
"""
pass
class RetrieveDestroyAPIView(RetrieveAPIView, DestroyAPIView):
"""
Concrete view for retrieving or deleting a model instance.
"""
pass
class RetrieveUpdateDestroyAPIView(RetrieveAPIView, UpdateAPIView, DestroyAPIView):
"""
Concrete view for retrieving, updating or deleting a model instance.
"""
pass |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I see numerous simple but possibly emotional issues for fields.py and test_fields.py which are both very large files. I would submit corresponding PRs as ideas the gist of which you can find below in no particular order:
1. Since fields.py and test_fields.py are very large they could possibly be split in some way. Parent and sub classes?
2. fields.py
BuiltinSignatureError Exception not required and could be replaced with a standard TypeError / AttributeError / other but maybe keep the error message.
CurrentUserDefault class could use a docstring and be reviewed together with the CreateOnlyDefault class
Field class:
BooleanField class: overly verbose and confusing, strtobool one of a couple of ideas
DecimalField class: constructor is overly verbose possibly default_error_messages too
CharField class: issues with constructor and run_validation function
ListField class: overly confusing constructor
3. test_fields.py: multiple tests should be reviewed:
Beta Was this translation helpful? Give feedback.
All reactions