WTForms post with SelectField not working - python

I have a form, and on submit I keep getting the error below. I can't work out what the problem is, but I think it has something to do with the selectfield as this is the first time I am using it and I haven't had problems before.
Here is my form:
class CampaignForm(Form):
name = StringField('Campaign Name', validators=[DataRequired])
start = DateField('Start', validators=[DataRequired], format='%d-%m-%Y')
end = DateField('End', validators=[DataRequired], format='%d-%m-%Y')
budget = IntegerField('Budget', validators=[DataRequired])
customer_id = SelectField(
'Customer', validators=[DataRequired], coerce=int)
Here is my view, GET works, but I keep getting an error on POST:
#app.route('/campaign/add', methods=['GET', 'POST'])
#login_required
def campaign_add():
form = CampaignForm()
form.customer_id.choices = [
(customer.id, customer.name)
for customer in current_user.account.customers]
if form.validate_on_submit():
campaign = Campaign(name=form.name.data,
start=form.start.data,
end=form.end.data,
budget=form.budget.data,
account_id=current_user.account_id,
customer_id=form.customer_id.data,
created_at=datetime.now(),
created_by=current_user.id,
updated_at=datetime.now(),
updated_by=current_user.id)
db.session.add(campaign)
db.session.commit()
return redirect(url_for('campaigns'))
return render_template('campaigns/add.html', form=form)
Here is the error that I am getting, and I can't work out what is wrong.
Traceback (most recent call last):
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/tornado/web.py", line 1309, in _execute
result = self.prepare()
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/tornado/web.py", line 2498, in prepare
self.fallback(self.request)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/livereload/server.py", line 89, in __call__
WSGIContainer.environ(request), start_response)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask_debugtoolbar/__init__.py", line 124, in dispatch_request
return view_func(**req.view_args)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask_login.py", line 758, in decorated_view
return func(*args, **kwargs)
File "/home/lee/Code/fastplan/src/fastplan/views.py", line 249, in campaign_add
if form.validate_on_submit():
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/flask_wtf/form.py", line 166, in validate_on_submit
return self.is_submitted() and self.validate()
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/wtforms/form.py", line 310, in validate
return super(Form, self).validate(extra)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/wtforms/form.py", line 152, in validate
if not field.validate(self, extra):
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/wtforms/fields/core.py", line 200, in validate
stop_validation = self._run_validation_chain(form, chain)
File "/home/lee/Code/fastplan/venv/lib/python3.4/site-packages/wtforms/fields/core.py", line 220, in _run_validation_chain
validator(form, self)
TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given

The issue is that lines like this:
validators=[DataRequired]
should be like this
validators=[DataRequired()]

Related

how to solve this error: "'TreeEnsemble' object has no attribute 'model_output'"

'''
features = [gender, SeniorCitizen, Partner, Dependents, Tenure, PhoneService, MultipleLines, OnlineSecurity, OnlineBackup,
DeviceProtection, TechSupport, StreamingTV, StreamingMovies, PaperlessBilling, MonthlyCharges, TotalCharges,
InternetService_Fiberoptic, InternetService_No, Contract_Oneyear,Contract_Twoyear,
PaymentMethod_CreditCard, PaymentMethod_ElectronicCheck, PaymentMethod_MailedCheck]
final_features = [np.array(features)]
prediction = model.predict_proba(final_features)
output = prediction[0,1]
# Shap Values
explainer = joblib.load(filename="explainer.bz2")
shap_values = explainer.shap_values(np.array(final_features))
shap_img = io.BytesIO()
shap.force_plot(explainer.expected_value[1], shap_values[1], columns, matplotlib = True, show = False).savefig(shap_img, bbox_inches="tight", format = 'png')
shap_img.seek(0)
shap_url = base64.b64encode(shap_img.getvalue()).decode()
The error is coming about tree ensemble when we try to run the python file.The error says: 'TreeEnsemble' object has no attribute 'model_output'. Please help to correct this error
the traceback is :
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Users\utrej\Desktop####\product dev lab\Customer-Survival-Analysis-and-Churn-Prediction-master\app.py", line 118, in predict
shap_values = explainer.shap_values(np.array(final_features))
File "C:\Users\utrej\AppData\Local\Programs\Python\Python38\Lib\site-packages\shap\explainers\tree.py", line 298, in shap_values
if self.model.model_output == "log_loss":

TypeError: _deserialize() got an unexpected keyword argument 'partial' in marshmallow

I'm trying image upload API i'm getting the following error
127.0.0.1 "POST //upload/image HTTP/1.1" 500 -
Traceback (most recent call last):
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 2463, in __call__
return self.wsgi_app(environ, start_response)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_restful\__init__.py", line 272, in error_router
return original_handler(e)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_restful\__init__.py", line 272, in error_router
return original_handler(e)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_restful\__init__.py", line 468, in wrapper
resp = resource(*args, **kwargs)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask\views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_restful\__init__.py", line 583, in dispatch_request
resp = meth(*args, **kwargs)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\flask_jwt_extended\view_decorators.py", line 108, in wrapper
return fn(*args, **kwargs)
File "D:\c_code\projects\python_api\resources\image.py", line 24, in post
data = image_schema.load(request.files)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\schema.py", line 723, in load
data, many=many, unknown=unknown, postprocess=True
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\schema.py", line 861, in _do_load
unknown=unknown,
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\schema.py", line 669, in _deserialize
index=index,
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\schema.py", line 493, in _call_and_store
value = getter_func(data)
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\schema.py", line 662, in <lambda>
val, field_name, data, **d_kwargs
File "D:\c_code\projects\python_api\.venv\lib\site-packages\marshmallow\fields.py", line 342, in deserialize
output = self._deserialize(value, attr, data, **kwargs)
TypeError: _deserialize() got an unexpected keyword argument 'partial'
The code of File "D:\c_code\projects\python_api\resources\image.py", line 24, in post is the following
from marshmallow import Schema, fields
from werkzeug.datastructures import FileStorage
from marshmallow import Schema, fields
from werkzeug.datastructures import FileStorage
class FileStorageField(fields.Field):
default_error_messages = {
"invalid": "Not a valid image."
}
def _deserialize(self, value, attr, data) -> FileStorage:
if value is None:
return None
if not isinstance(value, FileStorage):
self.fail("invalid")
return value
class ImageSchema(Schema):
image = FileStorageField(required=True)
The code is working fine when call the API image upload it is raising error.
I'm using flask marshmallow, Flask uploads, packages.
Since marshmallow 3, _deserialize may receive partial kwarg.
Every custom field should copy Field._deserialize signature and accept unknown kwargs.
def _deserialize(
self,
value: typing.Any,
attr: typing.Optional[str],
data: typing.Optional[typing.Mapping[str, typing.Any]],
**kwargs
):
Change your code like this to accept kwargs silently:
def _deserialize(self, value, attr, data, **kwargs) -> FileStorage:
if value is None:
return None

How to fix ValueError: DataFrame constructor not properly called on flask

I want to try to make a dataframe from pdfreader, with the column name is isi1. but why do I get an error ValueError: DataFrame constructor not properly called !. what should i do to fix this error. help from anyone when needed for this problem.
this is my code
if request.method == 'POST':
f = request.files['file']
f.save(f.filename)
pdfreader = PyPDF2.PdfFileReader(open('C:/Users/Novilia/PycharmProjects/tesaja/' + f.filename, 'rb'))
from pandas import DataFrame
df1 = DataFrame(pdfreader, columns=['isi1'])
#vect = count_vect.transform(['isi1']).toarray()
df1['label1'] = text_clf.predict(df1['isi1'])
df1.append(['label1'])
hasil = (df1.isi1[df1['label1'] == 'positif'])
len(hasil)
hasil_list = hasil.values.tolist()
stringList = ' '.join([str(item) for item in hasil_list])
hasil_ringkas = stringList
return render_template('result.html', ringkasan = hasil_ringkas)
the error is
ValueError
ValueError: DataFrame constructor not properly called!
Traceback (most recent call last)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 2463, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
raise value
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
raise value
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\flask\app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\Novilia\PycharmProjects\tesaja\app.py", line 79, in summarize
df1 = DataFrame(pdfreader, columns=['isi1'])
File "C:\Users\Novilia\PycharmProjects\tesaja\venv\lib\site-packages\pandas\core\frame.py", line 509, in __init__
raise ValueError("DataFrame constructor not properly called!")
ValueError: DataFrame constructor not properly called!
From my understanding, I guess you need to iterate over the pages and get the text from each page. can you try the following:
import nltk
pdfreader = PyPDF2.PdfFileReader(open('C:/Users/Novilia/PycharmProjects/tesaja/' + f.filename, 'rb'))
page_contents = [sent for page_no in range(pdfreader.getNumPages())
for sent in nltk.sent_tokenize(pdfreader.getPage(page_no).extractText())]
df1 = DataFrame(page_contents, columns=['isi1'])
Kindly let me know if you find any problem with the code.

Google App Engine/NDB: "BadValueError: Expected Key, got None" for saving perfectly fine entity

I'm currently porting a web app to Google App Engine, Python 3, Standard Environment. (So I'm new to GAE and NDB).
I have a bug here that I don't understand. I obtain an entity like so, the adjust properties, then save.
sourceUsers = User.query().filter(User.email == request.form.get('sourceUserEmail')).fetch(1)
if sourceUsers:
sourceUser = sourceUsers[0]
# manipulation:
sourceUser.sentInvitationSubscriptionKeys.append(subscription.key)
# verify key:
assert sourceUser.key != None
sourceUser.put()
But the saving triggers the following traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/yanone/Code/Google App Engine/typeworldappengine/main.py", line 500, in api
sourceUser.put()
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/_options.py", line 89, in wrapper
return wrapped(*pass_args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 78, in wrapper
return wrapped(*args, **new_kwargs)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 109, in positional_wrapper
return wrapped(*args, **kwds)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 4914, in _put
return self._put_async(_options=kwargs["_options"]).result()
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 190, in result
self.check_success()
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 137, in check_success
raise self._exception
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
yielded = self.generator.send(send_value)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 4974, in put
ds_entity = _entity_to_ds_entity(self)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 722, in _entity_to_ds_entity
names = prop._to_datastore(entity, data)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 2063, in _to_datastore
value = self._get_base_value_unwrapped_as_list(entity)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1551, in _get_base_value_unwrapped_as_list
wrapped = self._get_base_value(entity)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1537, in _get_base_value
return self._apply_to_values(entity, self._opt_call_to_base_type)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1834, in _apply_to_values
value[:] = map(function, value)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1612, in _opt_call_to_base_type
value = _BaseValue(self._call_to_base_type(value))
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1671, in _call_to_base_type
return call(value)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 1801, in call
new_value = method(self, value)
File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 3344, in _validate
"Expected Key, got {!r}".format(value)
google.cloud.ndb.exceptions.BadValueError: Expected Key, got None
In the debugging, I even made sure that the entity has a key (assert sourceUser.key != None). So I really don't get it. What am I doing wrong?
Mind you, all other entities save fine. Just this one doesn't.
Thank you.
I dont think this entity's primary key is the problem. It's probably another Key field on the object.
Whats the schema for the rest of you User object?

Flask-Restful Url field trys to build url with incorrect arguments

I want to add a resource's url to its serialization. However, using fields.Url raises werkzeug.routing.BuildError: Could not build url for endpoint 'url.user_endpoint' with values ['attribute_values']. Did you forget to specify values ['github_uuid']? How do I build the link to the user endpoint?
from flask_restful import Resource, marshal_with
from flask_restful import fields
from app.api import api
from app.api.autherization.service.userservice import UserService
user_fields = {
'uri': fields.Url('.user_endpoint'),
}
user_manager = UserService()
class UserResource(Resource):
#marshal_with(user_fields)
def get(self, github_uuid):
return user_manager.get_user(github_uuid)
api.add_resource(UserResource, '/users/<int:github_uuid>', endpoint='user_endpoint')
Traceback (most recent call last):
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_cors\extension.py", line 188, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 271, in error_router
return original_handler(e)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\_compat.py", line 32, in reraise
raise value.with_traceback(tb)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_cors\extension.py", line 188, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 271, in error_router
return original_handler(e)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\_compat.py", line 32, in reraise
raise value.with_traceback(tb)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 477, in wrapper
resp = resource(*args, **kwargs)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\views.py", line 84, in view
return self.dispatch_request(*args, **kwargs)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 587, in dispatch_request
resp = meth(*args, **kwargs)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 684, in wrapper
return marshal(resp, self.fields, self.envelope)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 640, in marshal
return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 639, in <genexpr>
for k, v in fields.items())
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\fields.py", line 155, in output
return marshal(value, self.nested)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 635, in marshal
if envelope else [marshal(d, fields) for d in data])
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 635, in <listcomp>
if envelope else [marshal(d, fields) for d in data])
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 640, in marshal
return OrderedDict([(envelope, OrderedDict(items))]) if envelope else OrderedDict(items)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\__init__.py", line 639, in <genexpr>
for k, v in fields.items())
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask_restful\fields.py", line 307, in output
o = urlparse(url_for(endpoint, _external=self.absolute, **data))
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\helpers.py", line 332, in url_for
return appctx.app.handle_url_build_error(error, endpoint, values)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\app.py", line 1811, in handle_url_build_error
reraise(exc_type, exc_value, tb)
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\_compat.py", line 33, in reraise
raise value
File "C:\Users\sangam\Anaconda3\lib\site-packages\flask\helpers.py", line 322, in url_for
force_external=external)
File "C:\Users\sangam\Anaconda3\lib\site-packages\werkzeug\routing.py", line 1758, in build
raise BuildError(endpoint, values, method, self)
werkzeug.routing.BuildError: Could not build url for endpoint 'url.user_endpoint' with values ['attribute_values']. Did you forget to specify values ['github_uuid']?

Categories

Resources