cluster edit is now data change. Also ordering of clusters
This commit is contained in:
parent
446e16d629
commit
b20ceca27a
|
@ -1,5 +1,5 @@
|
||||||
from message.message import Message
|
from message.message import Message
|
||||||
from message.simple_messages import NoReset
|
from message.simple_messages import NoReset, DataChgClickMessage
|
||||||
import message.common_accessors as common_accessors
|
import message.common_accessors as common_accessors
|
||||||
from browser import document
|
from browser import document
|
||||||
from model import Sense, Example
|
from model import Sense, Example
|
||||||
|
@ -100,14 +100,14 @@ class EditEntryLabels(Message):
|
||||||
model.entry.labels = labels
|
model.entry.labels = labels
|
||||||
|
|
||||||
|
|
||||||
class ExampleClusterEdit(NoReset):
|
class ExampleClusterEdit(DataChgClickMessage):
|
||||||
def update_model(self, model):
|
def update_model(self, model):
|
||||||
example = self.get_arg(0, Example)
|
example = self.get_arg(0, Example)
|
||||||
cluster = self.get_arg(1, int)
|
cluster = self.get_arg(1, int)
|
||||||
example.set_cluster(cluster)
|
example.set_cluster(cluster)
|
||||||
|
|
||||||
|
|
||||||
class ExampleClusterAdd(NoReset):
|
class ExampleClusterAdd(DataChgClickMessage):
|
||||||
def update_model(self, model):
|
def update_model(self, model):
|
||||||
example = self.get_arg(0, Example)
|
example = self.get_arg(0, Example)
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class ExampleClusters:
|
||||||
self.lists[key].add(cluster)
|
self.lists[key].add(cluster)
|
||||||
|
|
||||||
for key in self.lists.keys():
|
for key in self.lists.keys():
|
||||||
self.lists[key] = sorted(self.lists[key], key=lambda x: x)
|
self.lists[key] = sorted(self.lists[key], key=lambda x: int(x))
|
||||||
|
|
||||||
def _get_list(self, sense, example):
|
def _get_list(self, sense, example):
|
||||||
key = ExampleClusters.get_key(sense, example)
|
key = ExampleClusters.get_key(sense, example)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user