-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added menu items (openwisp-utils menu) for Subnet and IpAdress models. Added test for menu items in test_admin.py Also updated openwisp-utils and openwisp-users dependency in requirements files. Closes #37
- Loading branch information
1 parent
921be06
commit b130a44
Showing
5 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
from django.apps import AppConfig | ||
from openwisp_utils.api.apps import ApiAppConfig | ||
from openwisp_utils.utils import register_menu_items | ||
from swapper import get_model_name | ||
|
||
from .compat import patch_ipaddress_lib | ||
|
||
|
||
class OpenWispIpamConfig(AppConfig): | ||
class OpenWispIpamConfig(ApiAppConfig): | ||
name = 'openwisp_ipam' | ||
verbose_name = 'IPAM' | ||
|
||
def ready(self): | ||
def ready(self, *args, **kwargs): | ||
patch_ipaddress_lib() | ||
items = [ | ||
{'model': get_model_name('openwisp_ipam', 'Subnet')}, | ||
{'model': get_model_name('openwisp_ipam', 'IpAddress')}, | ||
] | ||
register_menu_items(items, name_menu='OPENWISP_DEFAULT_ADMIN_MENU_ITEMS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
coveralls | ||
django-extensions>=2.0.7 | ||
openwisp-utils[qa]~=0.6.0 | ||
openwisp-utils[qa]~=0.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters