-
Notifications
You must be signed in to change notification settings - Fork 257
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
Translated foreign key in an abstract base class: foreign key instances cannot be deleted. #727
Comments
I'm not sure. Do you get this error when you disable django-modeltranslation? |
I'm not sure, will try. |
Indeed, if I disable translation on one of the translated models, deletion is possible. I'll try to write a test, seems like a very edge case. |
benzkji
added a commit
to benzkji/django-modeltranslation
that referenced
this issue
Apr 20, 2024
benzkji
added a commit
to benzkji/django-modeltranslation
that referenced
this issue
Apr 20, 2024
please see PR, need directions for adding migrations :) |
benzkji
added a commit
to benzkji/django-modeltranslation
that referenced
this issue
Apr 20, 2024
The PR: #729 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a abstract
Link
base class, used for myTeaser
andContentNav
models. The base class has a fieldfile
, that is then translated in each of the real classes. The file field is aFileField
from django-filer, so basically aForeignKey
.When I try to delete a
File
instance, I get aTypeError / Cannot combine queries on two different base models.
from django itself. Thefile
field is configured ason_delete=models.SET_NULL
, and as far as I can tell, the error happens because django wants to update all the needed foreign key fields, but somehow gets two querysets of different models (the two translated above) to combine and update. Why exactly is very hard to tell.Has this happend before? I'll try to write a test, to rebuild the error - it currently happens in an old project, that was updated several times.
The text was updated successfully, but these errors were encountered: