Change the verbose name in the admin CMS

42 views
Skip to first unread message

Asakusa Tokugawa

unread,
Jul 13, 2013, 3:12:20 AM7/13/13
to django...@googlegroups.com

Hello again,

how can I override the filer foldername ("Folder", under /en/admin/) defined in "filer/models/foldermodels.py" in the admin CMS?

I try the following in the models.py:

from filer.models import Folder
class FilerFolder(Folder):
   
class Meta:
        verbose_name
= _("Folderoverview")
        verbose_name_plural
= _("Folderoverview")


and in the admin.py:

admin.site.register(FilerFolder, FolderAdmin)



But when I try to open the folder in the CMS, I received
an error:

NoReverseMatch at /en/admin/models/filerfolder/1/list/
Reverse for 'filer_folder_change' with arguments '(1,)' and keyword arguments '{}' not found.


Does anyone have an idea?

Thx,
Asakusa

Stefan Foulis

unread,
Jul 29, 2013, 2:41:37 AM7/29/13
to django...@googlegroups.com
Since the verbose name is on the Folder model, it is not easy to override by subclassing.

Not pretty at all, but probably monkey-patching it would work:

filer.models.Folder._meta.verbose_name = _("Folderoverview")
Reply all
Reply to author
Forward
0 new messages