Bugzilla – Bug 2597
Kiwi comboentries should allow duplicated strings in the list
Last modified: 2008-03-06 14:13:07 BRT
You need to log in before you can comment on or make changes to this bug.
I think it's a bad limitation if we do not allow duplicated strings in a comboentry. Imagine a combo which show a list of people by name. It's normal to have two or more people with the same name but the objects will be different and some other attributes two.
> and some other attributes two. s/two/too ;-)
(In reply to comment #0) > I think it's a bad limitation if we do not allow duplicated strings in a > comboentry. Imagine a combo which show a list of people by name. It's normal to > have two or more people with the same name but the objects will be different > and some other attributes two. How would a user decide between two items with identical string (two persons with same name in your example) given that the string is the only information he/she can see?
Example from Stoq: Traceback (most recent call last): File "/home/jdahlin/dev/stoq/trunk/stoq/stoq/gui/purchase/purchase.py", line 264, in _on_order_action_clicked self._open_order() File "/home/jdahlin/dev/stoq/trunk/stoq/stoq/gui/purchase/purchase.py", line 143, in _open_order edit_mode) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/application.py", line 117, in run_dialog return run_dialog(dialog_class, self, *args, **kwargs) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/dialogs.py", line 415, in run_dialog dialog = get_dialog(parent, dialog, *args, **kwargs) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/dialogs.py", line 384, in get_dialog dialog = dialog(*args, **kwargs) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py", line 372, in __init__ first_step = StartPurchaseStep(self, conn, model) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py", line 72, in __init__ WizardEditorStep.__init__(self, conn, wizard, model) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/base/wizards.py", line 51, in __init__ BaseEditorSlave.__init__(self, conn, model) File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/editors/baseeditor.py", line 103, in __init__ self.setup_proxies() File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py", line 124, in setup_proxies self._setup_widgets() File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py", line 89, in _setup_widgets self._fill_supplier_combo() File "/home/jdahlin/dev/stoq/trunk/stoqlib/stoqlib/gui/wizards/purchasewizard.py", line 79, in _fill_supplier_combo self.supplier.prefill(items) File "/home/jdahlin/dev/stoq/trunk/kiwi/kiwi/ui/comboentry.py", line 576, in prefill self.entry.prefill(itemdata, sort) File "/home/jdahlin/dev/stoq/trunk/kiwi/kiwi/ui/entry.py", line 1015, in prefill "%r into the entry" % text) KeyError: "Tried to insert duplicate value u'ZEM COMERCIO E INDUSTRIA LTDA' into the entry"
Resolvido na versão 0.9.2
Ali says this is still not fixed
Sorry, I was slightly mistaken. It is fixed when data mode on the combo is ENTRY_MODE_DATA, ie prefill with a list of pairs: (text, value). It does not however work when the mode is ENTRY_MODE_TEXT. I suppose this is reasonable since ENTRY_MODE_TEXT is kind of like a unique set of keys. I think the best behaviour would be that when ENTRY_MODE_TEXT is set and there are duplicates, foo (1), foo (2) etc should be displayed, but "foo" should be returned when the value is read. Maybe this is a bad idea, I haven't thought about it. Ali