def Translation(model):

    class Inner(models.Model):
        parent = models.ForeignKey(model, related_name='translations')
        language_code = models.CharField(
            _('language'), max_length=10,
            choices=settings.LANGUAGES, default=settings.LANGUAGES[0][0],
            editable=len(settings.LANGUAGES) > 1)

        class Meta:
            unique_together = ('parent', 'language_code')
            # (beware the above will not be inherited automatically if you
            #  provide a Meta class within your translation subclass)
            abstract = True

        def short_language_code(self):
            return short_language_code(self.language_code)

        def save(self, *args, **kwargs):
            super(Inner, self).save(*args, **kwargs)
            self.parent.purge_translation_cache()
        save.alters_data = True

        def delete(self, *args, **kwargs):
            super(Inner, self).delete(*args, **kwargs)
            self.parent.purge_translation_cache()
        delete.alters_data = True

    return Inner
Return a class which can be used as inheritance base for translation models
dataset/ETHPy150Open feincms/feincms/feincms/translations.py/Translation