Fix model docs and enchant spelling tokenizer
This commit is contained in:
parent
3155374185
commit
010dff2f9d
@ -16,10 +16,8 @@ import inspect
|
|||||||
import enchant
|
import enchant
|
||||||
import django
|
import django
|
||||||
|
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('../../'))
|
sys.path.insert(0, os.path.abspath('../../'))
|
||||||
|
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'access_controller.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'access_controller.settings')
|
||||||
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
|
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
|
||||||
|
|
||||||
@ -37,7 +35,6 @@ from django.db.models.query import QuerySet
|
|||||||
|
|
||||||
QuerySet.__repr__ = lambda self: self.__class__.__name__
|
QuerySet.__repr__ = lambda self: self.__class__.__name__
|
||||||
|
|
||||||
|
|
||||||
django.setup()
|
django.setup()
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
@ -87,6 +84,7 @@ def process_django_models(app, what, name, obj, options, lines):
|
|||||||
lines.append(':type %s: %s.%s' % (field.attname, module, field_type.__name__))
|
lines.append(':type %s: %s.%s' % (field.attname, module, field_type.__name__))
|
||||||
if enchant is not None:
|
if enchant is not None:
|
||||||
lines += spelling_white_list
|
lines += spelling_white_list
|
||||||
|
lines.append('')
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
||||||
@ -113,15 +111,17 @@ def skip_queryset(app, what, name, obj, skip, options):
|
|||||||
return True
|
return True
|
||||||
return skip
|
return skip
|
||||||
|
|
||||||
def fix_sig(app, what, name, obj, options, signature, return_annotation):
|
|
||||||
return ("", "")
|
|
||||||
|
|
||||||
# def setup(app):
|
def fix_sig(app, what, name, obj, options, signature, return_annotation):
|
||||||
# # Register the docstring processor with sphinx
|
return "", ""
|
||||||
# app.connect('autodoc-process-docstring', process_django_models)
|
|
||||||
# app.connect('autodoc-skip-member', skip_queryset)
|
|
||||||
# app.connect('autodoc-process-docstring', process_modules)
|
def setup(app):
|
||||||
# app.connect("autodoc-process-signature", fix_sig)
|
# Register the docstring processor with sphinx
|
||||||
|
app.connect('autodoc-process-docstring', process_django_models)
|
||||||
|
app.connect('autodoc-skip-member', skip_queryset)
|
||||||
|
app.connect('autodoc-process-docstring', process_modules)
|
||||||
|
app.connect("autodoc-process-signature", fix_sig)
|
||||||
|
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
@ -139,7 +139,6 @@ extensions = {
|
|||||||
'sphinxcontrib.spelling',
|
'sphinxcontrib.spelling',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
|
|
||||||
@ -186,17 +185,17 @@ autodoc_typehints = "description"
|
|||||||
|
|
||||||
# spell checking
|
# spell checking
|
||||||
spelling_lang = 'ru_RU'
|
spelling_lang = 'ru_RU'
|
||||||
tokenizer_lang = 'ru_RU'
|
tokenizer_lang = 'en_US'
|
||||||
spelling_exclude_patterns=['ignored_*', '../../main/models.py']
|
spelling_exclude_patterns = ['ignored_*', '../../main/models.py']
|
||||||
spelling_show_suggestions = True
|
spelling_show_suggestions = True
|
||||||
spelling_show_whole_line=True
|
spelling_show_whole_line = True
|
||||||
spelling_warning=True
|
spelling_warning = True
|
||||||
spelling_ignore_pypi_package_names = True
|
spelling_ignore_pypi_package_names = True
|
||||||
spelling_ignore_wiki_words=True
|
spelling_ignore_wiki_words = True
|
||||||
spelling_ignore_acronyms=True
|
spelling_ignore_acronyms = True
|
||||||
spelling_ignore_python_builtins=True
|
spelling_ignore_python_builtins = True
|
||||||
spelling_ignore_importable_modules=True
|
spelling_ignore_importable_modules = True
|
||||||
spelling_ignore_contributor_names=True
|
spelling_ignore_contributor_names = True
|
||||||
|
|
||||||
# -- Options for todo extension ----------------------------------------------
|
# -- Options for todo extension ----------------------------------------------
|
||||||
|
|
||||||
@ -206,6 +205,3 @@ set_type_checking_flag = True
|
|||||||
typehints_fully_qualified = True
|
typehints_fully_qualified = True
|
||||||
always_document_param_types = True
|
always_document_param_types = True
|
||||||
typehints_document_rtype = True
|
typehints_document_rtype = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ class UserProfile(models.Model):
|
|||||||
Модель профиля пользователя.
|
Модель профиля пользователя.
|
||||||
|
|
||||||
Профиль создается и изменяется при создании и изменении модель User.
|
Профиль создается и изменяется при создании и изменении модель User.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@ -33,7 +34,9 @@ class UserProfile(models.Model):
|
|||||||
@property
|
@property
|
||||||
def zendesk_role(self) -> str:
|
def zendesk_role(self) -> str:
|
||||||
"""
|
"""
|
||||||
Функция возвращает роль пользователя в Zendesk в формате str, либо UNDERFINED, если пользователь не найден.
|
Функция возвращает роль пользователя в Zendesk.
|
||||||
|
|
||||||
|
В формате str, либо UNDEFINED, если пользователь не найден
|
||||||
|
|
||||||
:return: Роль пользователя в Zendesk
|
:return: Роль пользователя в Zendesk
|
||||||
"""
|
"""
|
||||||
@ -72,7 +75,7 @@ def save_user_profile(instance, **kwargs) -> None:
|
|||||||
|
|
||||||
class RoleChangeLogs(models.Model):
|
class RoleChangeLogs(models.Model):
|
||||||
"""
|
"""
|
||||||
Модель для логирования изменений ролей пользователя.
|
Модель для логгирования изменений ролей пользователя
|
||||||
"""
|
"""
|
||||||
user = models.ForeignKey(to=User, on_delete=models.CASCADE,
|
user = models.ForeignKey(to=User, on_delete=models.CASCADE,
|
||||||
help_text='Пользователь, которому присвоили другую роль')
|
help_text='Пользователь, которому присвоили другую роль')
|
||||||
@ -105,6 +108,7 @@ class UnassignedTicketStatus(models.IntegerChoices):
|
|||||||
class UnassignedTicket(models.Model):
|
class UnassignedTicket(models.Model):
|
||||||
"""
|
"""
|
||||||
Модель не распределенного тикета.
|
Модель не распределенного тикета.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
assignee = models.ForeignKey(to=User, on_delete=models.CASCADE, related_name='tickets',
|
assignee = models.ForeignKey(to=User, on_delete=models.CASCADE, related_name='tickets',
|
||||||
help_text='Пользователь, с которого снят тикет')
|
help_text='Пользователь, с которого снят тикет')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user