|
@@ -9,6 +9,8 @@ from tracim_backend.exceptions import ContentStatusNotExist
|
9
|
9
|
####
|
10
|
10
|
# Content Status
|
11
|
11
|
from tracim_backend.lib.core.application import ApplicationApi
|
|
12
|
+if typing.TYPE_CHECKING:
|
|
13
|
+ from tracim_backend.app_models.applications import Application
|
12
|
14
|
|
13
|
15
|
|
14
|
16
|
class GlobalStatus(Enum):
|
|
@@ -167,19 +169,19 @@ class ContentTypeList(object):
|
167
|
169
|
|
168
|
170
|
@property
|
169
|
171
|
def Folder(self):
|
170
|
|
- return self.get_one_by_slug('folder')
|
|
172
|
+ return self.get_one_by_slug(folder_type)
|
171
|
173
|
|
172
|
174
|
@property
|
173
|
175
|
def File(self):
|
174
|
|
- return self.get_one_by_slug('file')
|
|
176
|
+ return self.get_one_by_slug(file_type)
|
175
|
177
|
|
176
|
178
|
@property
|
177
|
179
|
def Page(self):
|
178
|
|
- return self.get_one_by_slug('html-document')
|
|
180
|
+ return self.get_one_by_slug(html_documents_type)
|
179
|
181
|
|
180
|
182
|
@property
|
181
|
183
|
def Thread(self):
|
182
|
|
- return self.get_one_by_slug('thread')
|
|
184
|
+ return self.get_one_by_slug(thread_type)
|
183
|
185
|
|
184
|
186
|
def __init__(self, app_list: typing.List['Application']):
|
185
|
187
|
self.app_list = app_list
|
|
@@ -190,7 +192,6 @@ class ContentTypeList(object):
|
190
|
192
|
def _content_types(self):
|
191
|
193
|
app_api = ApplicationApi(self.app_list)
|
192
|
194
|
content_types = app_api.get_content_types()
|
193
|
|
- # content_types.extend(self._special_contents_types)
|
194
|
195
|
return content_types
|
195
|
196
|
|
196
|
197
|
def get_one_by_slug(self, slug: str) -> ContentType:
|