def backwards(self, orm):
        # Convert all fields back to the single-language table.
        for sharedcontent in orm['sharedcontent.SharedContent'].objects.all():
            translations = orm['sharedcontent.SharedContent_Translation'].objects.filter(master_id=sharedcontent.id)
            try:
                # Try default translation
                translation = translations.get(language_code=appsettings.FLUENT_CONTENTS_DEFAULT_LANGUAGE_CODE)
            except __HOLE__:
                try:
                    # Try internal fallback
                    translation = translations.get(language_code__in=('en-us', 'en'))
                except ObjectDoesNotExist:
                    # Hope there is a single translation
                    translation = translations.get()

            sharedcontent.title = translation.title
            sharedcontent.save()
dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/plugins/sharedcontent/south_migrations/0003_migrate_translated_fields.py/Migration.backwards