class Entry(models.Model):
author = models.ForeignKey(Author, related_name="entries")
blog = models.ForeignKey(Blog, related_name="entries")
pictures = models.ManyToManyField(Picture, blank=True,
related_name="entries")
comments_allowed = models.BooleanField(_("Comments allowed"))
posted = models.DateTimeField(_("Date posted"), auto_now_add=True)
class Translation(multilingual.Translation):
title = models.CharField(_("Title"), maxlength=250,
help_text=_("Title of the entry"))
slug = models.SlugField(prepopulate_from=("name",))
body = models.TextField(_("Body"))
As you see, it has both translatable and non-translatable fields. I'm
running Django-0.96 on python2.5. I use psycopg2 db adapter.
Eugene
Aliases must be quoted by django, but they aren't. I've tried to find
what causes this quoting error but gave up after two hours... Need to
get some sleep.
Did anyone attempted to use django-multilingual?
Eugene
On May 22, 5:44 pm, Eugene Morozov <eugene.moro...@gmail.com> wrote:
> I'm trying to use django-multilingual for multilingual site, instead
> of reinventing the wheel. But in admin interface I get:
> "Something's wrong with your database installation. Make sure the
> appropriate database tables have been created, and make sure the
> database is readable by the appropriate user." for every translatable
> model.
A knee-jerk question here is: did you remember to run syncdb after
creating the translatable models? If you did, try again and make sure
there were no validation errors.
> slug = models.SlugField(prepopulate_from=("name",))
The prepopulate_from parameter contains a nonexistant field name (you
probably wanted to use "title" instead), but apparently Django does
not validate it. I just pasted your Entry model into one of apps in
my testproject, added missing models (Author, Blog and Picture) and it
simply worked for me.
If syncdb does not help, then please try to create a minimal test app
for the problem and post it to django-multilingual bug tracker (http://
code.google.com/p/django-multilingual/).
-mk
On May 22, 9:28 pm, Eugene Morozov <eugene.moro...@gmail.com> wrote:
> In addition to this issue, I'm getting SQL errors on attempts to savemultilingualobjects, because of such invalid constructs:
It is the same issue: django-multilingual constructs incorrect table
names for language codes that contain a dash.
I just committed a fix for that.
> Aliases must be quoted by django, but they aren't. I've tried to find
> what causes this quoting error but gave up after two hours... Need to
> get some sleep.
They are not because this part of SQL is generated by D-M, not Django
core, in multilingual/query.py. I should probably fix it soon.
Thanks for trying out D-M and submitting the bug report,
-mk
On 23 май, 00:06, "marcin.kaszyn...@gmail.com"
Interesting. I have no idea why 'i18n.blog' works and
'i18n.multilingual' does not, but as a quick workaround you can put
'multilingual' instead of 'i18n.multilingual' in INSTALLED_APPS.
I see the same problem here, it looks like something is causing a
circular import. I will have to look into it later.
-mk