0

I need help with this error, I have a series of SelectFields with multiple choices declared in the class like this one:

 TIP_FINANZIAMENTO = SelectField('TIP_FINANZIAMENTO' choices=[('',''),('01', '01 -Mortage with amortization/repayment plan'),('02'......... 
and goes on for a while, it's pretty long.

There are more than one like this. I have tried to remove all choices because I thought maybe I put too many but it returns the same error:

ValueError: too many values to unpack

These fields are then passed to a QuickForm in the front end page. Any Idea why this is happening?

RETURNS THE FOLLOWING ERROR File "/home/itad/DICP_evo_dev/venv/lib/python2.7/site-packages/wtforms/fields/core.py", line 454, in iter_choices

        super(SelectField, self).__init__(label, validators, **kwargs)

        self.coerce = coerce

        self.choices = copy(choices)



    def iter_choices(self):

        for value, label in self.choices:

            yield (value, label, self.coerce(value) == self.data)



    def process_data(self, value):

        try:

            self.data = self.coerce(value)

ValueError: too many values to unpack

fahime
  • 179
  • 2
  • 12
mar
  • 1
  • 4
  • Might be the version of Flask? I have the following Flask==1.0.2 Flask-Bootstrap==3.3.7.1 Flask-Login==0.4.1 Flask-Mail==0.9.1 Flask-Migrate==2.4.0 Flask-Moment==0.7.0 Flask-Script==2.0.6 Flask-SQLAlchemy==2.3.2 Flask-WTF==0.14.2 – mar May 23 '19 at 08:52
  • on the official website Version 2.2 has this : Fix a compatibility issue with SQLAlchemy 2.1 that caused QuerySelectField to fail with ValueError: too many values to unpack. (#391) – mar May 23 '19 at 08:53
  • Check this out please https://stackoverflow.com/a/7053615/11230028 it may help you+ – Chetan Vashisth May 23 '19 at 10:04
  • but this is only python issue, I'm using Flask WTF, the error seems coming from there, SelectField from WTF – mar May 23 '19 at 10:15

0 Answers0