Skip to content

Instantly share code, notes, and snippets.

@dinopetrone
Created November 20, 2012 19:00
Show Gist options
  • Save dinopetrone/4120206 to your computer and use it in GitHub Desktop.
Save dinopetrone/4120206 to your computer and use it in GitHub Desktop.
class ExcludedWordManager(models.Manager):
def get_excluded(self, test_words):
temp_set = set(test_words.split(' '))
r = redis.from_url(settings.REDIS_HOST)
all_excluded_words = r.smembers('excluded_words')
return temp_set & all_excluded_words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment