Closed ernests closed 3 years ago
Hi! Have used Python-eve for a while now and had to switch from Mongo to eve-sqlalchemy backend.
I'm having several collections where I have one-to-one, many-to-many case. I have multiple items which can have multiple categories. I have looked into https://github.com/pyeve/eve-sqlalchemy/tree/master/eve_sqlalchemy/examples/many_to_many. I built example and tried to post parent with children:
endpoint = "http://127.0.0.1:5000/" r = requests.post(f"{endpoint}parents", data= {"id": 23, "children": [2]}) r.json()
Response:
{'_status': 'ERR', '_issues': {'children': 'must be of list type'}, '_error': {'code': 422, 'message': 'Insertion failure: 1 document(s) contain(s) error(s)'}}
Only time I'm not getting error is when I post list().
list()
Am I missing something about the way it is supposed to work?
Problem might have been on my side as I didn't delete existing Postgres tables before changing schema. Closing this.
Hi! Have used Python-eve for a while now and had to switch from Mongo to eve-sqlalchemy backend.
I'm having several collections where I have one-to-one, many-to-many case. I have multiple items which can have multiple categories. I have looked into https://github.com/pyeve/eve-sqlalchemy/tree/master/eve_sqlalchemy/examples/many_to_many. I built example and tried to post parent with children:
Response:
Only time I'm not getting error is when I post
list()
.Am I missing something about the way it is supposed to work?