You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to post a JSON payload via my endpoint /network, I get the following error.
TypeError: '_updated' is an invalid keyword argument for Network
I would assume that inserting into the DB via POST should be fairly trivial without requiring anything else.
Am I missing any additional configuration at all?
Eve v0.7.10
Eve-SQLAlchemy v0.7.1
Flask:0.12
Werkzeug: 0.11.15
I fixed this by adding a bunch of conditionals at sqlalchemy.ext.declarative.base
I'm sure this isn't the right way to do this.
Line: 386
cls_ = type(self)
for k in kwargs:
if k == "_updated" or k == "_created" or k=="_etag":
pass
elif not hasattr(cls_, k):
raise TypeError(
"%r is an invalid keyword argument for %s" % (k, cls_.__name__)
)
setattr(self, k, kwargs[k])
We have used CommonColumns abstract class to provide attributes used by Eve, such as _created and _updated. These are not needed if you are only reading from the database. However, if your API is also writing to the database, then you need to include them.
Hi,
When I try to post a JSON payload via my endpoint /network, I get the following error.
TypeError: '_updated' is an invalid keyword argument for Network
I would assume that inserting into the DB via POST should be fairly trivial without requiring anything else.
Am I missing any additional configuration at all?
Eve v0.7.10
Eve-SQLAlchemy v0.7.1
Flask:0.12
Werkzeug: 0.11.15
Thanks!
Full error message is here: https://gist.github.com/virtualvinodh/ced063f382a2cd1c397cee28f736b9ea
The text was updated successfully, but these errors were encountered: