Spirit icon indicating copy to clipboard operation
Spirit copied to clipboard

Topic tags

Open sirex opened this issue 9 years ago • 10 comments

This is feature request for adding tags for topics.

Categories are good way to organize topics, but tags would add much more flexibility.

sirex avatar Jan 10 '16 22:01 sirex

@nitely please share your thoughts on implementation. How will https://github.com/nitely/django-hooks come into play?

clintonb avatar Jan 27 '16 06:01 clintonb

My thoughts on this are along the following lines:

  • Make tags discoverable ala StackOverFlow
  • Add tags within the creation topic form
  • Clicking a tag (at any place the appear) should take the user to a topic list filtered by that tag
  • I think there should not be a fixed set of tags, I mean, users should just make them up, otherwise they accomplish the same as categories. Although, a topic can belong to many tags and can not belong to many categories, so it may make sense to have a fixed set. I think supporting both options would not be much more effort (but IMO the first one makes more sense)
  • The form field should have an auto complete built on top of haystack.

Adding tags to the search makes little sense, since they are not discoverable that way (something I saw in your PR).

django-hooks can make the topic creation form extensible, and provide places to insert code within the template (ie: show the tags, add item to menu, etc). Any model can be extended via a OneToOneField.

nitely avatar Jan 27 '16 06:01 nitely

Aside from the fact that it's incompatible with django-hooks, any opposition to using django-taggit? It makes since to me to use it rather than re-create the wheel.

I agree with most of what you have written. Tags should not be confined to a fixed set.

I disagree regarding search. Adding tags to the indexed data gives users the ability to search based on those terms, rather than having to know a tag URL.

Would the UI be a prerequisite for merging this functionality? I intend to use Spirit to replace an existing backend forums service, so all I need is the backend and a RESTful API.

clintonb avatar Jan 27 '16 06:01 clintonb

Honestly, I don't care much about how plugins are implemented, they are out of my hands. I can only give some advice. It won't get merge, since it is a plugin (a pluggable app actually), people will install it or not.

nitely avatar Jan 27 '16 06:01 nitely

django-hooks doesn't go deep enough to cover model/search index changes. It seems to be more cosmetic than anything else. Any plans to support more robust changes? Any chance you've considered following django-oscar's model, supporting the "forking" of apps?

clintonb avatar Jan 27 '16 07:01 clintonb

It seems to be more cosmetic than anything else.

Django let you extend urls (by just overriding them), react to signals, override templates, extend models through FK and friends. django-hooks adds extensible templates and forms. What else do you need?

Any chance you've considered following django-oscar's model, supporting the "forking" of apps?

How would it help to extend the search functionality?

nitely avatar Jan 27 '16 07:01 nitely

I've explored more and see the architecture. Adding the basic tagging model seems pretty straightforward.

Oscar's forking model allows the entire app to be overridden by another, allowing some modules to be replaced with user-created modules. What I am missing is a method to extend TopicIndex to add the tags. It seems my only option is to replace the template (either via django-hooks or ensuring my project's template directory is loaded first); however, I don't see an obvious method of adding a field to TopicIndex.

It's 3AM here in Cambridge, so let me know if I'm being dense.

clintonb avatar Jan 27 '16 07:01 clintonb

I'd have to dig up how TopicIndex can be extended. I will go through haystack docs tomorrow and let you know.

Oscar's forking model allows the entire app to be overridden by another

Spirit does not aim to have overridable apps, you should be able to extend it, add features, but not remove or swap parts of the core, except for what Django allows (ie: the user model).

It's 3AM here in Cambridge, so let me know if I'm being dense.

it's 5AM here in Bs.As, haha

nitely avatar Jan 27 '16 08:01 nitely

I'd have to dig up how TopicIndex can be extended. I will go through haystack docs tomorrow and let you know.

I've an idea how this can be done. I'll work on it over the weekend.

nitely avatar Jan 28 '16 16:01 nitely

I've created a hook for haystack, seems to be working. Usage, template.txt can be extended with a template hook.

nitely avatar Jan 31 '16 17:01 nitely