Closed GoogleCodeExporter closed 9 years ago
digging into it a little bit, we figured out the best solution is to prevent
double
tag in the strip_split function called by parse_tag_input
Index: utils.py
===================================================================
--- utils.py (révision 127)
+++ utils.py (copie de travail)
@@ -90,7 +90,7 @@
return []
words = [w.strip() for w in input.split(delimiter)]
- return [w for w in words if w]
+ return list(set([w for w in words if w]))
def edit_string_for_tags(tags):
"""
Original comment by pierrer...@yahoo.fr
on 16 Jan 2008 at 10:49
Can you give an example of some tag input which is giving you problems?
parse_tag_input already ensures there are no duplicates by doing this before it
returns the list of words, so updated_tag_names should already be unique:
words = list(set(words))
The following test (in tagging.tests.tests) currently passes:
>>> parse_tag_input('"two", one, one, two, "one"')
[u'one', u'two']
Original comment by jonathan.buchanan
on 16 Jan 2008 at 11:11
Argh, unless you only have a space-delimited string, that is!
Failed example:
parse_tag_input('one one two two')
Expected:
[u'one', u'two']
Got:
[u'one', u'one', u'two', u'two']
Original comment by jonathan.buchanan
on 16 Jan 2008 at 11:15
Fixed in revision 128 - thanks for the report.
Original comment by jonathan.buchanan
on 16 Jan 2008 at 11:23
Original issue reported on code.google.com by
pierrer...@yahoo.fr
on 16 Jan 2008 at 10:32