I've been trying to use feincms TreeEditor for some mptt registered
models of mine but I get a bad changelist for the admin.
The editor still sort of works, but displays (None) for every row in
the changelist.
At first I thought I was doinig something wrong but then I tried the
example in feincms and found out that the editor works fine for Pages
but has the same problem my models have when editing Categories.
I followed this steps:
http://magicrebirth.wordpress.com/2009/08/18/django-admin-and-mptt-2/#comment-140
And I also compared my setup with the feincms Category example and
they are the same.
Versions I am using:
Django – 1.2-beta-1 – active (rev.12437)
FeinCMS – 1.0.4 – active development
django-mptt – 0.3-pre – active development (rev.121)
Any hints on what may be causing this?
Thanx,
NicoEchániz
Looks like this (None) was coming from not having a get_absolute_url()
method defined in my model.
TreeEditor.__init__ () adds 'indented_short_title' to the admin
list_display and this indented_short_title method calls a
get_absolute_url() method from your model which is not present unless
you define it.
this commit introduced this problem:
http://github.com/matthiask/feincms/commit/98e44d0ea4e70e80ca8bd6eff8863a2c54eb2395
I commited to my fork a version of tree_editor.py that checks if the
model has a get_absolute_url method before trying to use it:
http://github.com/nicoechaniz/feincms/commit/17740b4d72b1a80fa5dc14b32beb545ba076058c
I don't know what's the process for you to integrate this simple
modification, I'm new to github.
On 15 feb, 11:31, NicoEchániz <n...@rakar.com> wrote:
> Hi,
>
> I've been trying to use feincms TreeEditor for some mptt registered
> models of mine but I get a bad changelist for the admin.
> The editor still sort of works, but displays (None) for every row in
> the changelist.
>
> At first I thought I was doinig something wrong but then I tried the
> example in feincms and found out that the editor works fine for Pages
> but has the same problem my models have when editing Categories.
>
> I followed this steps:http://magicrebirth.wordpress.com/2009/08/18/django-admin-and-mptt-2/...
On Mon, Feb 15, 2010 at 6:28 PM, NicoEchániz <ni...@rakar.com> wrote:
> Ok,
>
> Looks like this (None) was coming from not having a get_absolute_url()
> method defined in my model.
>
> TreeEditor.__init__ () adds 'indented_short_title' to the admin
> list_display and this indented_short_title method calls a
> get_absolute_url() method from your model which is not present unless
> you define it.
>
> this commit introduced this problem:
> http://github.com/matthiask/feincms/commit/98e44d0ea4e70e80ca8bd6eff8863a2c54eb2395
>
> I commited to my fork a version of tree_editor.py that checks if the
> model has a get_absolute_url method before trying to use it:
> http://github.com/nicoechaniz/feincms/commit/17740b4d72b1a80fa5dc14b32beb545ba076058c
>
> I don't know what's the process for you to integrate this simple
> modification, I'm new to github.
>
You can send a merge request, or a notice to this mailing list. I
still have quite a few branches to review and merge (I'll hopefully be
able to do this tomorrow), but your changes are not controversial at
all and are already merged.
Thanks
Matthias