Hi,

the library is getting very close to being actually usable in real
projects.

There were several changes in the last few days.  It is now possible
to:

1. use language codes in methods that until now accepted only language
   IDs;

2. create query sets with default language set, so that the following
   tests pass:

   >>> c_en = Category.objects.all().for_language('en')
   >>> c_pl = Category.objects.all().for_language('pl')
   >>> c_en.get(name__contains='1').name
   'category 1'
   >>> c_pl.get(name__contains='1').name
   'kategoria 1'

   >>> [c.name for c in  c_en.order_by('name')]
   ['category 2', 'category 1']
   >>> [c.name for c in c_pl.order_by('-name')]
   ['kategoria 2', 'kategoria 1']

   Objects created using such a queryset also have a default language
   set:

   >>> c = c_en.get(id=1)
   >>> c.name = 'test'
   >>> (c.name, c.name_en, c.name_pl)
   ('test', 'test', 'kategoria 1')

   >>> c = c_pl.get(id=1)
   >>> c.name = 'test'
   >>> (c.name, c.name_en, c.name_pl)
   ('test', 'category 1', 'test')

3. order the admin list view according to the value of translatable
   column; this requires a small and generic patch to Django, see
   http://code.djangoproject.com/ticket/3397

   You can still use the library without any changes to Django source,
   the only difference will be that translatable columns will not be
   sortable.  I hope the patch will be included, though, because there
   are more use cases for the patch than django-multilingual :)

4. use the translatable fields to create filters spanning multiple
   tables, like `somemodel.filter(category__name__contains='2')`,

5. assign directly to translatable fields in different language
   versions.  These two have the same effect:

   c.set_name('category name', 'en')
   c.name_en = 'category name'

The last big piece missing is a better inline editor for translated
content.  Right now it is still a hack that works correctly mostly for
instances created by the admin interface.  I hope to have this working
soon.

-mk


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to