ojii / django-multilingual-ng

THIS PROJECT IS *NOT* SUPPORTED AND SHOULD NOT BE USED UNLESS YOU KNOW EXACTLY WHAT YOU'RE DOING!!!

Home Page:https://github.com/KristianOellegaard/django-hvad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work with django 1.2

rasca opened this issue · comments

commented

Hi, this isn't working with django 1.2, when I try to edit something in the admin, no translatable field appears.

Could you please be more specific about what exactly does not work? And maybe paste your models.py/admin.py. Just saying "it isn't working" is not helping at all, especially since that is not true. It works fine (with some known bugs) for me and it only works on 1.2 (so don't even try running it on 1.1 please).

commented

I'm really sorry, for the poor description, I don't know why I did that. :-(

The problem is the following, I'm migrating from django 1.0 to django 1.2. I've done all the necessary migrations, and the front-end works flawlessly with the db changes, django-multilingual-ng and django 1.2. It arises when using the admin. I happens in every model in my app.

I haven't subclassed any admin template. For example, one of my models is the following (models.py):

class Tecnica(models.Model):
    class Translation(TranslationModel):
        nombre = models.CharField(max_length=100)
        desrcipcion = models.TextField(blank=True)
    def __unicode__(self):
        return self.nombre
    class Meta:
        verbose_name = 'técnica'

in my admin.py I have:

admin.site.register(Tecnica)

What I get is an empty fieldset in the admin when creating or adding a new Tecnica.
In more complex models the admin only shows the non-translatable fields. An example: http://i49.tinypic.com/5ag5yr.png (the yellow line is FireBug, I was checking that the fieldset was empty...)

My installed apps are:

INSTALLED_APPS = (
    'localeurl',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'multilingual',
    'sayus.galeria',
    'rosetta',
    'sorl.thumbnail',
    'django_extensions',
    'south',
    'debug_toolbar',
)

I've tried disabling one app by one, in the case one of them was causing the problem, but no luck so far.

My middlewares and my template context processors:

MIDDLEWARE_CLASSES = (
    'localeurl.middleware.LocaleURLMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'multilingual.middleware.DefaultLanguageMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'multilingual.context_processors.multilingual',
    'django.core.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'sayus.galeria.context_processors.artistas',
    'sayus.galeria.context_processors.newsletter',
    'sayus.galeria.context_processors.buscador_lateral',
    'django.core.context_processors.media',
)

Maybe I'm missing something, but I'm clueless right now.
Thanks a lot, and again I apologize for the previous description.

you have to use MultilingualModelAdmin with your multilingual models. so in your admin.py from multilingual.admin import MultilingualModelAdmin and admin.site.register(Tecnica, MultilingualModelAdmin).

commented

Thanks a lot!!
Maybe add a couple of lines regarding the admin in the docs? It could go in usage.

yea docs are generally a thing i'm lacking. docs and time to write the docs :D