I also was looking for a solution for it and I found that the most
optimal is the first approach --at least for me--.

You have a normal table with data entered into a language by default,
and then it's used another one to translating the text fields from
that main table.

The difference with yours is that I use:

   lang = models.ForeignKey('Language')


On 24 ene, 17:41, Adrián Ribao <ari...@gmail.com> wrote:
> Hello everybody,
>
> I need to create dinamic content in several models. I have 3
> approaches:
>
> approach 1:
>
> class News(models.Model):
>     date = ...
>     visible = ...
>     text = models.CharField(max_length=255)
>
> class NewsTrans(models.Model):
>     news = models.ForeignKey(News)
>     lang = models.CharField(max_length=5, choices=settings.LANGUAGES)
>     text = models.CharField(max_length=255)
>
> approach 2:
> class News(models.Model):
>     lang = models.CharField(max_length=5, choices=settings.LANGUAGES)
>     date = ...
>     visible = ...
>     text = models.CharField(max_length=255)
>
> approcah 3:
> class NewsBase():
>     date = ...
>     visible = ...
>
> class News(NewsBase):
>     lang = models.CharField(max_length=5, choices=settings.LANGUAGES)
>     text = models.CharField(max_length=255)
>
> (Any other approaches are welcome.)
>
> The one I like the least is the second one.
>
> I really need help here, please tell me how to implement translations
> in ddbb in the most efficient way.
>
> Thank you.
>
> P.S. I hope Django can manage this problem, hopefully in 1.3!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to