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

FeinCMS requires querying using queryset.values(...)

wernight opened this issue · comments

I'm using FeinCMS admin menu with multilingual and it seems that this set is incompatible because it raises an exception:

NotImplementedError("Multilingual fields cannot be queried using queryset.values(...)")

because it tries to call MultilingualQuery.values_list() from feincms/admin/tree_editor.py:

for p_id, parent_id in cls.objects.order_by(cls._meta.tree_id_attr, cls._meta.left_attr).values_list("pk", "%s_id" % cls._meta.parent_attr):

Note: This was working with the original multilingual and old Django.

I would suggest you have a look at cms solutions with built in true multilinguality, such as django-cms.

@ojii
I did and I like it very much. Saddly it lacks (until next major version) of one feature I used FeinCMS for: Custom admin menu of a tree. Sure I could use jsTree and implement it again myself together with Django-MPTT but just felt lazy.

Well, thanks for the tip anyway.

well we gonna release an RC of django-cms 2.1 shortly. also as long as you don't use the publisher (cms moderation) the current master is very stable.

This feature should be added in Django-CMS 2.2 as far as I know. I'll be watching for it to use it ASAP.

I implemented a fix for this on my branch: piquadrat@e283ada77d9f4fae3c1d

The problem is that FeinCMS specifically asks for the column name, and not the field name (probably because of memory considerations). My patch checks (awkwardly), if a field is a foreign key. If that's the case, field + '_id' is added to the allowed fields.

I haven't found a way to add a pull request to an existing ticket, but feel free to pull, anyway :-)