Closed cryarchy closed 8 years ago
So I went digging around the file /home/user/tizy/MyFlask/e2-papers/venv/local/lib/python2.7/site-packages/flask_restless/serialization.py and added the code print(document)
at line 692. The flask-debug console now prints:
...
{u'username': u'cryarchy', 'authToken': 'U08UXA5J8PD6PDU7JXWZMR4Q', 'person': <e2papers.app.Person.model.Person object at 0x7f69ca865490>, 'date': '02/06/2016 08:58:51', u'password': u'Pass1234', u'email': u'email@domain.com'}
...
as the document. The comment under the call function however states that Everything in the document
other than the data
element is ignored. I don't know if this is intended and if so, how do I adapt my code to this behavior?
Noticed my mistake after a revisit to https://flask-restless.readthedocs.io/en/1.0.0b1/creating.html. The post request data format is what I'd got wrong. It should be:
data = {'data': {'attributes': {u'username': u'cryarchy', u'password': u'Pass1234', u'email': u'email@domain.com'}, 'type': 'account'}}
Yes, sorry about the sudden change. Flask-Restless 1.0.0 will support only the JSON API protocol.
I have the following code:
after the request, the flask-debug console displays the following:
The data is getting printed on the debug window because I have the following POST preprocessor:
NB: I get the same results when I make the POST request from Angular2 post