-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fixed labels order #3987
Fixed labels order #3987
Conversation
cvat/apps/engine/serializers.py
Outdated
@@ -79,6 +79,7 @@ class LabelSerializer(serializers.ModelSerializer): | |||
class Meta: | |||
model = models.Label | |||
fields = ('id', 'name', 'color', 'attributes', 'deleted') | |||
ordering = ['-id'] |
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.
Could you please add a link on documentation about the field? I can see such parameter for Django Models: https://docs.djangoproject.com/en/3.2/ref/models/options/#ordering
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.
Or may be on the DRF source code. Because in IAM PR I deleted all such fields.
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.
Could not find any reference. So, moved to custom prefetching of related fields.
Motivation and context
External bug report
How has this been tested?
No tests, due to no issue reproduction on development setup.
Checklist
develop
branch- [ ] I have updated the documentation accordingly- [ ] I have added tests to cover my changes- [ ] I have linked related issues (read github docs)- [ ] I have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.