modeltranslation support

Issue #19 resolved
Fabio Caccamo created an issue

I know best practices with urls and slugs, but if you need it, it would be nice having the integration with modeltranslation.

Comments (6)

  1. Stephan Herzog

    +1 Have you found a way around this? I guess it could be possible with custom_slugify()... I'll play a little bit around with that.

  2. Fabio Caccamo reporter

    The only way I founded is to set always_update = False then override the save method:

    def save(self, *args, **kwargs):
    
            for lang_code, lang_verbose in settings.LANGUAGES:
                lang_code = lang_code.replace('-', '_')
    
                setattr(self, 'slug_%s' % lang_code, slugify( getattr(self, 'name_%s' % lang_code, u'') ))
    
            super( NameSlugModel, self ).save( *args, **kwargs )
    
  3. Log in to comment