X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/fa8909f95f314f1bea5f52b81381304c68a75417..5120532d42f2130dd250ec7089d28d9d0fa2b09c:/migdal/helpers.py?ds=sidebyside diff --git a/migdal/helpers.py b/migdal/helpers.py index 2de7ab0..11f8ddc 100644 --- a/migdal/helpers.py +++ b/migdal/helpers.py @@ -89,3 +89,9 @@ def add_translatable_index(index_class, fields, languages=None): setattr(index_class, fname, new_field) index_class.fields[fname] = new_field + +def translated_fields(field_names, languages=settings.LANGUAGES): + return tuple("%s_%s" % (field_name, lang_code) + for field_name in field_names + for lang_code, lang_name in languages + )