-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Reorder books #2338 #2810
Reorder books #2338 #2810
Conversation
|
Hi, thanks for your PR. As smilerz said there is some room for improvement, espcecially since this adds a lot of code to the frontend. We usually do ordering in tandoor by adding an For automatic ordering this is not needed as you could just add a query param to the API, for manual ordering that field could be edited by the user (not very user friendly but thats also the case for properties) but automatic ordering and manual ordering could conflict so that needs to be taken into account. |
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.
see comments above, please also make sur to share a draft of what you want to do before writing code so that we can save you time by giving feedback directly (see https://docs.tandoor.dev/contribute/)
Hallo, For automatic ordering i think its pretty straight forward. i added 2 options for ordering through the api client
manual ordering: |
ascending and descending should be part of the API/Serializer, not the model. Take a look at SupermarketCategory for an example on how this has been handled. |
Hi @smilerz and @vabene1111, |
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.
ok finally got around to reviewing this, just 2 minor changes and we are good to go
cookbook/views/api.py
Outdated
@@ -651,15 +651,23 @@ def destroy(self, *args, **kwargs): | |||
content = {'error': True, 'msg': e.args[0]} | |||
return Response(content, status=status.HTTP_403_FORBIDDEN) | |||
|
|||
|
|||
import json |
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.
please have imports on the top of the file
Implemented the ability to sort books in four different ways:
Manual Sorting Features:
Note: This pull request addresses issue #2338.