Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging system #22

Closed
fluffy-critter opened this issue Apr 5, 2018 · 3 comments · Fixed by #176
Closed

Tagging system #22

fluffy-critter opened this issue Apr 5, 2018 · 3 comments · Fixed by #176
Labels
enhancement New feature or request
Milestone

Comments

@fluffy-critter
Copy link
Collaborator

It'd be helpful to be able to tag/filter posts (separately from Entry-Type); Entry-Type generally is used only for affecting layout/visibility, whereas tags are used for filtering with one or more attributes. (For example, in a comic, being able to tag entries based on characters or subject matters.)

An efficient strategy for implementing this would start with adding Tag and EntryTag columns to the database, where Tag provides the plaintext strings and EntryTag associates them with the entry. When an entry is scanned its EntryTag associations would be destroyed before the existing ones are added. Adding the appropriate joined expression to the view query is not something I want to think about right now.

@fluffy-critter fluffy-critter added the enhancement New feature or request label Apr 5, 2018
@fluffy-critter
Copy link
Collaborator Author

Well, okay, the query would probably be something like:

select = select.join(Tag)
if type(tag) == str:
    where = where & (Tag.name == tag)
else:
    where = where & (Tag.name << tag)

@fluffy-critter
Copy link
Collaborator Author

(modulo changes for PonyORM)

@fluffy-critter
Copy link
Collaborator Author

Is there any reason to normalize tags? I don't think there is; columns can just be EntryID, TagString. TagString could probably be stored/searched as its .lower(), even.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant