builtins.TypeError TypeError: 'float' object is not callable
发表在Python图书答疑
2021-03-03
《Python项目开发案例集锦》第17章 51商城
是否精华
是
否
版块置顶:
是
否
builtins.TypeError TypeError: 'float' object is not callable Traceback (most recent call last) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 2310, in __call__ return self.wsgi_app(environ, start_response) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 2296, in wsgi_app response = self.handle_exception(e) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\_compat.py", line 35, in reraise raise value File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 2293, in wsgi_app response = self.full_dispatch_request() File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\_compat.py", line 35, in reraise raise value File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "F:\pythonproject\51Shop\app\admin\views.py", line 157, in login if form.validate_on_submit(): # 验证提交表单 File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask_wtf\form.py", line 101, in validate_on_submit return self.is_submitted() and self.validate() File "F:\pythonproject\51Shop\venv\Lib\site-packages\wtforms\form.py", line 310, in validate return super(Form, self).validate(extra) File "F:\pythonproject\51Shop\venv\Lib\site-packages\wtforms\form.py", line 152, in validate if not field.validate(self, extra): File "F:\pythonproject\51Shop\venv\Lib\site-packages\wtforms\fields\core.py", line 206, in validate stop_validation = self._run_validation_chain(form, chain) File "F:\pythonproject\51Shop\venv\Lib\site-packages\wtforms\fields\core.py", line 226, in _run_validation_chain validator(form, self) File "F:\pythonproject\51Shop\app\admin\forms.py", line 45, in validate_manager admin = Admin.query.filter_by(manager=account).count() File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 3230, in count return self.from_self(col).scalar() File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2983, in scalar ret = self.one() File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2954, in one ret = self.one_or_none() File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2924, in one_or_none ret = list(self) File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2995, in __iter__ return self._execute_and_instances(context) File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\orm\query.py", line 3018, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 948, in execute return meth(self, multiparams, params) File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\sql\elements.py", line 269, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1055, in _execute_clauseelement ret = self._execute_context( File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1147, in _execute_context fn(self, cursor, statement, parameters, File "F:\pythonproject\51Shop\venv\Lib\site-packages\sqlalchemy\events.py", line 624, in wrap_before_cursor_execute orig_fn(conn, cursor, statement, File "F:\pythonproject\51Shop\venv\Lib\site-packages\flask_sqlalchemy\__init__.py", line 252, in before_cursor_execute context._query_start_time = _timer() TypeError: 'float' object is not callable