Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Tag and query #4

@recoma96

Description

@recoma96

지금 구현된 API는 Tag에 대한 OR 쿼리 즉 여러개의 태그 중 하나만 해당되도 검색이 되는 API
in문으로 간단히 해결했지만 And Query는 생각해 봐야 할 문제.
기존의 query단에서 여러개의 tag의 매칭을 하는 방법을 생각해 봐야 할 필요가 있음

        if tags:
            # 태그 검색 (OR query)
            tag_list = tags.split(',')
            query = query.join(DataTag, DataTag.datainfo_id == DataInfo.id)
            query = query.join(Tag, Tag.id == DataTag.tag_id)
            query = query.filter(Tag.name.in_(tag_list))

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions