You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
django-parler properly retrieves the object from database 'default', but looks for the translation from database 'test' ! (SQL trace below, see the very end of each line):
SELECT "orchestra_instrumentfamily"."id", "orchestra_instrumentfamily"."code" FROM "orchestra_instrumentfamily" WHERE "orchestra_instrumentfamily"."code" = 'TEST_FAM' LIMIT 21; args=('TEST_FAM',); alias=default
SELECT "orchestra_instrumentfamily_translation"."id", "orchestra_instrumentfamily_translation"."language_code", "orchestra_instrumentfamily_translation"."label", "orchestra_instrumentfamily_translation"."master_id" FROM "orchestra_instrumentfamily_translation" WHERE ("orchestra_instrumentfamily_translation"."master_id" = 34 AND "orchestra_instrumentfamily_translation"."language_code" = 'en') LIMIT 21; args=(34, 'en'); alias=test
This problem was originally reported on StackOverflow ([https://stackoverflow.com/questions/73792025/django-parler-how-to-store-and-retrieve-a-translated-model-to-from-more-than-on/74730082#74730082]) where the original author of django-parler (vdboor) confirmed this is likely to be a bug : django-parler doesn't pass the "using()" information to its internal queries that retrieve translation model data.
The text was updated successfully, but these errors were encountered:
Hello,
My model is:
I have 2 database aliases 'default' and 'test' and my database router directs my model to 'test'.
I insert models in both databases by doing this:
which stores the object and its translations in database 'test', or by doing this:
which saves the object and its translations to database 'default'. So far, so good.
But when accessing the object previously saved in 'default' by doing this (after properly clearing all caches to force a database read):
django-parler properly retrieves the object from database 'default', but looks for the translation from database 'test' ! (SQL trace below, see the very end of each line):
This problem was originally reported on StackOverflow ([https://stackoverflow.com/questions/73792025/django-parler-how-to-store-and-retrieve-a-translated-model-to-from-more-than-on/74730082#74730082]) where the original author of django-parler (vdboor) confirmed this is likely to be a bug : django-parler doesn't pass the "using()" information to its internal queries that retrieve translation model data.
The text was updated successfully, but these errors were encountered: