Private
Public Access
1
0

solved losing Empower data

This commit is contained in:
Sander Roosendaal
2017-05-19 13:27:09 +02:00
parent a84ddf73d9
commit 3bf512179c
3 changed files with 70 additions and 43 deletions

View File

@@ -343,6 +343,7 @@ class FusionMetricChoiceForm(ModelForm):
def __init__(self, *args, **kwargs):
super(FusionMetricChoiceForm, self).__init__(*args, **kwargs)
formaxlabels2 = formaxlabels.copy()
# need to add code to remove "empty" fields
if self.instance.id is not None:
@@ -350,14 +351,14 @@ class FusionMetricChoiceForm(ModelForm):
df = dataprep.getrowdata_db(id=id)[0]
labeldict = {key:value for key,value in self.fields['columns'].choices}
for label in labeldict:
if df.ix[:,label].std() == 0:
try:
formaxlabels.pop(label)
formaxlabels2.pop(label)
except KeyError:
pass
metricchoices = list(sorted(formaxlabels.items(), key = lambda x:x[1]))
metricchoices = list(sorted(formaxlabels2.items(), key = lambda x:x[1]))
self.fields['columns'].choices = metricchoices