bookieio / Bookie

Python based delicious.com replacement
GNU Affero General Public License v3.0
633 stars 138 forks source link

exclude tags in search #516

Open anarcat opened 10 years ago

anarcat commented 10 years ago

i'd like to be able to do searches in tags but exclude some tags in the search.

i would expect a search like todo -ignore to show me all entries tagged todo but not tagged ignore.

rakeshmahadasa commented 10 years ago

@mitechie
This seems interesting. I would like to work on this. Should I create another field to enter tags that should be ignored or is there any other easy way?

sahilbabbar commented 10 years ago

Instead of ignoring some tags why not make the search more efficient.

yashmehrotra commented 9 years ago

@mitechie This seems like a nice idea, I don't think anyone is currently working on this so I would like to do it. My work would include -

  1. search works like python bookie -github so all tags containing python and bookie and not containing github will be shown.
  2. The color of the ignored tags in the search bar will change to red to show they are ignored. 3.Writing unit tests for the above.
anarcat commented 9 years ago

any progress here?

yashmehrotra commented 9 years ago

@anarcat Oops, My mistake, I had made some progress on it, but forgot about it, I will complete the above mentioned tasks and send a pull request in 2-3 days.

anarcat commented 9 years ago

hey don't beat yourself up, thanks for doing this!! :)

yashmehrotra commented 9 years ago

@anarcat Hi, I am facing some issues with sqlalchemy, basically , I took all the excluded tags in a list. Then in https://github.com/bookieio/Bookie/blob/develop/bookie/models/__init__.py#L469 I added a 'NOT IN' functionality -

and_(
          Tag.name.in_(tags),
          Tag.name.notin_(tags_exclude),
          bmarks_tags.c.tag_id == Tag.tid
   )

tags_exclude is a list of tags to be excluded ( ['foo','bar'] ) But I am not getting the desired result. Any Pointers ?

anarcat commented 9 years ago

could you send a pull request with what you have so far? i don't have time to review right now, but maybe others could, and having the complete set of changes will make it easier to provide help and feedback. thanks!