feincms/feincms — pull request #233 by frog32 (2011-12-07 13:11:04+00:00)
Title: there was an error in the queryset transformation for translation lookup

bevore this patch it was searching for translations with pk = pk from the translated object. it should search on the foreignkey field instead, but it didn't work with parent_id__in=... because django didn't recognize the field. so i used parent__pk__in=

this results in the following sql query using a sqlite database (example from a recent project):
SELECT "catalog_producttranslation"."id", "catalog_producttranslation"."parent_id", "catalog_producttranslation"."language_code", "catalog_producttranslation"."name", "catalog_producttranslation"."short_description", "catalog_producttranslation"."description" FROM "catalog_producttranslation" WHERE ("catalog_producttranslation"."parent_id" IN (8192, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8204, 8205, 8207, 8209, 8210, 8211, 8212, 8214, 8215, 8216, 8217, 8218) AND ("catalog_producttranslation"."language_code" LIKE de ESCAPE '\' OR "catalog_producttranslation"."language_code" LIKE de ESCAPE '\' )) ORDER BY "catalog_producttranslation"."language_code" DESC

and it finds all translations in the first attempt now