Closed GoogleCodeExporter closed 9 years ago
I need help!!!!!!!
Original comment by Lehab...@gmail.com
on 25 May 2012 at 6:22
try this:
in settings.py remove the project name from the import:
MODELTRANSLATION_TRANSLATION_REGISTRY = 'project_name.translation'
Change it to:
MODELTRANSLATION_TRANSLATION_REGISTRY = 'translation'
Original comment by anto...@projecto24.com
on 11 Jun 2012 at 1:04
i check it, but problem not fix
Original comment by Lehab...@gmail.com
on 12 Jun 2012 at 3:55
Could be the rare (but known) race condition where the models aren't all loaded
but modeltranslation tries to register them. The recent changes regarding app
registration (per-app with autoregister in urls.py) in trunk are supposed to
resolve this issue.
Original comment by eschler
on 10 Jul 2012 at 9:21
Im still getting this error, with multiple models....
/****************** ERROR ***************************/
super(TranslationAdmin, self).__init__(*args, **kwargs)
File "/home/udemunco/.env/env/lib/python2.7/site-packages/modeltranslation/admin.py", line 26, in __init__
self.trans_opts = translator.get_options_for_model(self.model)
File "/home/udemunco/.env/env/lib/python2.7/site-packages/modeltranslation/translator.py", line 463, in get_options_for_model
'translation' % model.__name__)
modeltranslation.translator.NotRegistered: The model "Person" is not registered
for translation
/****************** ERROR ***************************/
translation.py -
from modeltranslation.translator import translator, TranslationOptions
from .models import Category, Person, Home, Article, Footer
class CategoryTranslationOptions(TranslationOptions):
fields = ('label', 'slug', 'topBannerTitle')
class PersonTranslationOptions(TranslationOptions):
fields = ('role')
admin.py -
from django.contrib import admin
from .models import Category, CategoryAdmin, Footer, FooterAdmin, Home,
HomeAdmin, Person, PersonAdmin, Article, ArticleAdmin
from django_markdown.admin import MarkdownModelAdmin
from modeltranslation.admin import TranslationAdmin,
TranslationGenericStackedInline
class CategoryAdmin(TranslationAdmin):
class Media:
js = (
'modeltranslation/js/force_jquery.js',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
'modeltranslation/js/tabbed_translation_fields.js',
)
css = {
'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
}
class PersonAdmin(TranslationAdmin):
class Media:
js = (
'modeltranslation/js/force_jquery.js',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
'modeltranslation/js/tabbed_translation_fields.js',
)
css = {
'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
}
admin.site.register(Category, CategoryAdmin)
admin.site.register(Person, PersonAdmin);
Original comment by abfelixs...@gmail.com
on 11 Aug 2014 at 5:53
Original issue reported on code.google.com by
Lehab...@gmail.com
on 9 May 2012 at 4:02