-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: add option to link existing objects of m2m fields instead of cloning them #752
feat: add option to link existing objects of m2m fields instead of cloning them #752
Conversation
…oning them resolves tj-django#703
for more information, see https://pre-commit.ci
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.
Thanks for implementing a fix, could you ensure that the test covers your changes if applicable.
Codecov Report
@@ Coverage Diff @@
## main #752 +/- ##
==========================================
+ Coverage 99.76% 99.77% +0.01%
==========================================
Files 9 9
Lines 846 894 +48
==========================================
+ Hits 844 892 +48
Misses 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
model_clone/mixin.py
Outdated
destination = getattr(duplicate, field.attname) | ||
|
||
if all( | ||
[ |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces).
|
||
for f in self._meta.many_to_many: | ||
if any( | ||
[ |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces).
model_clone/mixin.py
Outdated
): | ||
fields.add(f) | ||
|
||
for f in self._meta.related_objects: |
Check warning
Code scanning / Pylint (reported by Codacy)
Variable name "f" doesn't conform to snake_case naming style
model_clone/mixin.py
Outdated
for f in self._meta.related_objects: | ||
if f.many_to_many: | ||
if any( | ||
[ |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces).
Man, all these checks are nice! 👏 I'll fix the coverage and remaining linting in a bit. |
@jackton1 looks like that
https://results.pre-commit.ci/run/github/172541739/1675087809.NoG7DgCwSrG2-ErufHjEBw |
Yep there's some issue with the isort package I'll fix that up now. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@all-contributors please add @DanielSchaffer for code, test |
I've put up a pull request to add @DanielSchaffer! 🎉 |
Closes: #703