-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapps.py
More file actions
52 lines (35 loc) · 1.13 KB
/
apps.py
File metadata and controls
52 lines (35 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- coding: utf-8 -*-
"""
本アドオンの各種プロパティを定義する
"""
import os
from addons.base.apps import BaseAddonAppConfig
from . import SHORT_NAME
HERE = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_PATH = os.path.join(
HERE,
'templates'
)
# `__init__.py` の `default_app_config` により本ファイル内の`AddonAppConfig`が参照される
class AddonAppConfig(BaseAddonAppConfig):
short_name = SHORT_NAME
name = 'addons.{}'.format(SHORT_NAME)
label = 'addons_{}'.format(SHORT_NAME)
full_name = 'My Skelton'
owners = ['node']
views = []
# admin対応: accountsを追加
configs = ['node', 'accounts']
categories = ['other']
include_js = {}
include_css = {}
node_settings_template = os.path.join(TEMPLATE_PATH, 'node_settings.mako')
# admin対応: プロパティを追加
user_settings_template = os.path.join(TEMPLATE_PATH, 'user_settings.mako')
@property
def routes(self):
from . import routes
return [routes.api_routes]
@property
def node_settings(self):
return self.get_model('NodeSettings')