Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Jul 8, 2025

Motivation and context

  • Set related_query_name to singular nouns, which matches the Django default (and also some of the existing model fields).

  • Fix inconsistent related_names in CloudStorage fields.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • [ ] I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@SpecLad
Copy link
Contributor Author

SpecLad commented Jul 8, 2025

/check

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2025

🚫 Workflows has been canceled
📄 See logs here

@SpecLad SpecLad marked this pull request as ready for review July 8, 2025 14:03
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2025

Comment on lines 589 to 594
on_delete=models.SET_NULL, related_name="owners")
on_delete=models.SET_NULL, related_name="tasks", related_query_name="task")
assignee = models.ForeignKey(User, null=True, blank=True,
on_delete=models.SET_NULL, related_name="assignees")
on_delete=models.SET_NULL, related_name="+")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I partially fixed it in the PR.

Why do you keep a backward relation for owned tasks but delete such a relation for assigned ones?
Additionally, shouldn't we define a consistent scheme for User <-> Job, User <-> Task, User <-> Project relations?
(e.g., now the User modal still has a backward relation for assigned jobs with the default name; backward relations for assigned and owned projects don't exist; backward relation for owned tasks exists)

Copy link
Contributor Author

@SpecLad SpecLad Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you keep a backward relation for owned tasks but delete such a relation for assigned ones?

It wasn't clear to me whether a backwards relation for assigned tasks would be useful or what its name should be (I just knew that the current name wasn't good 🙂), so I figured removing it would be a reasonable option.

Additionally, shouldn't we define a consistent scheme for User <-> Job, User <-> Task, User <-> Project relations?

Yeah, I agree. I didn't even realize that user.jobs is currently the user's assigned jobs. 😵‍💫

Do you think it's useful to have backwards relations for assigned tasks, jobs, etc.? I see that in your PR you name them assigned_X, but you don't seem to actually be using them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, having thought about your PR some more, I like your solution for the assignee fields, so I'm going to pause this PR until you complete yours.

@SpecLad SpecLad marked this pull request as draft July 9, 2025 09:49
@SpecLad SpecLad force-pushed the related-names branch 2 times, most recently from 6ff1bd7 to 1b70464 Compare September 8, 2025 16:21
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2025

@SpecLad SpecLad marked this pull request as ready for review September 8, 2025 16:24
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.36%. Comparing base (650f2b2) to head (fca5765).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9621      +/-   ##
===========================================
+ Coverage    82.28%   82.36%   +0.08%     
===========================================
  Files          483      483              
  Lines        49323    49313      -10     
  Branches      4132     4132              
===========================================
+ Hits         40587    40619      +32     
+ Misses        8736     8694      -42     
Components Coverage Δ
cvat-ui 77.06% <ø> (+0.15%) ⬆️
cvat-server 86.36% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SpecLad SpecLad requested a review from zhiltsov-max September 9, 2025 09:56
…` models

* Set `related_query_name` to singular nouns, which matches the Django default
  (and also some of the existing model fields).

* Fix inconsistent `related_name`s in `CloudStorage` fields.
@sonarqubecloud
Copy link

@SpecLad SpecLad merged commit ef27ba7 into cvat-ai:develop Oct 31, 2025
40 checks passed
@SpecLad SpecLad deleted the related-names branch October 31, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants