37d762da8431b8f59f08d09b4e5767c97c2143c7
1 from floof
.model
import Art
, Tag
, TagText
6 tagtexts
= TagText
.query
.filter(TagText
.text
.in_(tags
))
7 tagtext_ids
= [_
.id for _
in tagtexts
]
9 # Fetch art that has all the tags
10 artwork
= Art
.query
.join(Tag
) \
11 .filter(Tag
.tagtext_id
.in_(tagtext_ids
)) \
26 components
= word
.split(':')
27 if len(components
) == 1:
30 elif components
[0] == "rating":
31 if components
[1].isnumeric():
32 score
= int(components
[1])
34 score
= Rating
.reverse_options
.get(components
[1])
38 # TODO: Find stuff that has this rating
39 # Rating.query.filter(Rating.s)
41 tagtexts
= TagText
.query
.filter(TagText
.text
.in_(tags
))
42 tagtext_ids
= map(lambda x
:x
.id, tagtexts
)