Skip to content

Commit

Permalink
Merge pull request #91 from nemesisdesign/configurable-appconfig
Browse files Browse the repository at this point in the history
Added support for configurable app verbose name
  • Loading branch information
Alir3z4 authored Dec 15, 2018
2 parents 5bc0542 + 068d871 commit 6897fcb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ django-plans changelog
* Supporting Django 2.1
* The range when the plan was extended is now stored in `Order.plan_extended_from` and `Order.plan_extended_until`.
* UserPlans are now automatically created with initial migration or with `create_userplans` adminaction.
* Added possibility to define `PLANS_APP_VERBOSE_NAME` to personalize plans' `verbose_name`

0.8.13
------
Expand Down
7 changes: 7 additions & 0 deletions docs/source/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,14 @@ Example::

PLANS_TAX_COUNTRY = 'PL'

``PLANS_APP_VERBOSE_NAME``
--------------------------

**Optional**

Default: ``plans``

The ``verbose_name`` of django-plans' ``AppConfig``.

.. note::

Expand Down
2 changes: 2 additions & 0 deletions plans/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = '0.8.13'

default_app_config = 'plans.apps.PlansConfig'
8 changes: 8 additions & 0 deletions plans/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.apps import AppConfig

from . import conf as app_settings


class PlansConfig(AppConfig):
name = 'plans'
verbose_name = app_settings.APP_VERBOSE_NAME
1 change: 1 addition & 0 deletions plans/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
TAXATION_POLICY = getattr(settings,
'PLANS_TAXATION_POLICY',
'plans.taxation.TAXATION_POLICY')
APP_VERBOSE_NAME = getattr(settings, 'PLANS_APP_VERBOSE_NAME', 'plans')

0 comments on commit 6897fcb

Please sign in to comment.