bmihelac / feincms-feincmsext

Extensions for FeinCMS
11 stars 4 forks source link

Page permissions missing verbose name #3

Closed Gwildor closed 11 years ago

Gwildor commented 11 years ago

The page permissions app misses a verbose name for the "Page" field, therefor making it untranslatable. The "User" field and the "Permission" field work fine, I was able to translate those, but the page field stubbornly stays at "Page" (probably a catch for missing verbose name by FeinCMS I reckon) instead of a translation I tried to add via Django's locale django.po.

I tried to "fix" this on my installation by adjusting the source myself like this: In feincmsext/simple_permission/models.py at line 33 replacing page = models.ForeignKey(Page) with page = models.ForeignKey(Page, verbose_name=_('Page'))

However, this didn't work for some very weird unknown (to me) reason. It was only until I adjusted feincmsext/simple_permission/admin.py like this: Replacing line 16 like this: return TreeNodeChoiceField(queryset = Page.tree.all(), empty_label = "---------") with return TreeNodeChoiceField(queryset = Page.tree.all(), empty_label = "---------", label='Page')

That I got it to work. Note that on both attempts I didn't actually used "Page" but rather a placeholder just to try and change the admin panel. In the first case it didn't work, in the second it did.

Either way it's a real hindrance, especially because I don't want to adjust dependencies at all, let alone for these bugs. Could you please have a look at this?

Gwildor commented 11 years ago

Interestingly enough, I just discovered that the verbose_name argument for the ForeignKey does change the "On page" part for the filter when looking at all the current page permissions.

bmihelac commented 11 years ago

@Gwildor yes, replacing original fk field with TreeNodeChoiceField would require to set label. Feel free to make a pull request.

bmihelac commented 11 years ago

Thanks!