solved losing Empower data
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user