daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. forms.py", line 31, in __init__
  2. project = Project.objects.filter(id=kwargs('pk')).first()
  3. TypeError: 'dict' object is not callable
  4.      
  5. class PredictionCreateModelForm(forms.Form):
  6.  
  7. global COLUMNS
  8. name = forms.CharField()
  9. model_type = forms.ChoiceField(choices=PREDICTION_TYPE, widget=forms.RadioSelect)
  10. columns = forms.MultipleChoiceField(
  11.     choices=COLUMNS,
  12.     widget=forms.CheckboxSelectMultiple)
  13.  
  14. def __init__(self, *args, **kwargs):
  15.     super(PredictionCreateModelForm, self).__init__(*args, **kwargs)
  16.     project = Project.objects.filter(id=kwargs('pk')).first()
  17.  
  18.     df = pd.read_csv(project.base_file)
  19.  
  20.     global COLUMNS
  21.     COLUMNS = df.columns
  22.  
  23. class Meta:
  24.     model = PredictionModel
  25.     fields = ['name', 'model_type', 'columns']
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top