OBS: run migrations! This changes the Msg model to work with ManyToManyFields rather than with custom string representations for storing multiple receivers or channels. It also expands the Msg object with a "title" field and various filter options. This should make it easier to implement mail-like operations using the comms system.

This commit is contained in:
Griatch 2012-08-30 00:05:00 +02:00
parent 7995c91eee
commit dcc7f29a91
8 changed files with 656 additions and 381 deletions

View file

@ -724,7 +724,5 @@ def string_suggestions(string, vocabulary, cutoff=0.6, maxnum=3):
Returns:
list of suggestions from vocabulary (could be empty if there are no matches)
"""
#if string in vocabulary:
# return [string]
return [tup[1] for tup in sorted([(string_similarity(string, sugg), sugg) for sugg in vocabulary],
key=lambda tup: tup[0], reverse=True) if tup[0] >= cutoff][:maxnum]