Пример #1
0
def update_tag_description(tag: model.Tag, description: str) -> None:
    assert tag
    if util.value_exceeds_column_size(description, model.Tag.description):
        raise InvalidTagDescriptionError('Description is too long.')
    tag.description = description or None
Пример #2
0
def update_tag_category_name(tag: model.Tag, category_name: str) -> None:
    assert tag
    tag.category = tag_categories.get_category_by_name(category_name)
Пример #3
0
def update_tag_suggestions(tag: model.Tag, relations: List[str]) -> None:
    assert tag
    if _check_name_intersection(_get_names(tag), relations, False):
        raise InvalidTagRelationError('Tag cannot suggest itself.')
    tag.suggestions = get_tags_by_names(relations)
Пример #4
0
def update_tag_description(tag: model.Tag, description: str) -> None:
    assert tag
    if util.value_exceeds_column_size(description, model.Tag.description):
        raise InvalidTagDescriptionError("Description is too long.")
    tag.description = description or None
Пример #5
0
def update_tag_suggestions(tag: model.Tag, relations: List[str]) -> None:
    assert tag
    if _check_name_intersection(_get_names(tag), relations, False):
        raise InvalidTagRelationError("Tag cannot suggest itself.")
    tag.suggestions = get_tags_by_names(relations)
Пример #6
0
def update_tag_category_name(tag: model.Tag, category_name: str) -> None:
    assert tag
    tag.category = tag_categories.get_category_by_name(category_name)
Пример #7
0
def update_tag_suggestions(tag: model.Tag, relations: List[str]) -> None:
    assert tag
    if _check_name_intersection(_get_names(tag), relations, False):
        raise InvalidTagRelationError('태그는 자기 자신을 제안 태그로 지정할 수 없습니다.')
    tag.suggestions = get_tags_by_names(relations)
Пример #8
0
def update_tag_implications(tag: model.Tag, relations: List[str]) -> None:
    assert tag
    if _check_name_intersection(_get_names(tag), relations, False):
        raise InvalidTagRelationError('Tag cannot imply itself.')
    tag.implications = get_tags_by_names(relations)