wlanslovenija / django-tastypie-mongoengine

MongoEngine support for django-tastypie.
Other
73 stars 59 forks source link

How to update DictField ? #34

Closed burakkilic closed 11 years ago

burakkilic commented 11 years ago

Hi;

I am trying to update a resoure. My data is: { "tokens" : { "first_token": "xasdadjasdh22939123" } }

I am doing a PUT request and getting 204. But nothing happens.

Any example how people do that?

mitar commented 11 years ago

Please create a pull request with your resource definition and example you are trying to do and let's see.

burakkilic commented 11 years ago

I think I cannot explain it on a pull request. Could you please try to update a DictField like in the test? It will get 204 but not updating the field actually.

mitar commented 11 years ago

I do not understand. You should create a test which behaves in the way you describe. How do you expect me to be able to try it out otherwise?

burakkilic commented 11 years ago

I understand you, but you already did this test with:

UPDATED: response = self.c.put(dictfieldtest_uri, '{"dictionary": {"a": 341, "number": "abcd"}}', content_type='application/json') self.assertEqual(response.status_code, 204) in the 317. line of

django-tastypie-mongoengine / tests / test_project / test_app / tests / test_basic.py

I only checked the database and see that nothing happens in the database.

mitar commented 11 years ago

Database is cleaned after each test.

So if there is some check missing in the test, feel free to add it. If it works,then it obviously works for me.

BTW, that is POST not PUT.

mitar commented 11 years ago

So you should find what is different between your situation and the test and try to add that to tests.

mitar commented 11 years ago

So, how is this progressing? Have you learned how to update DictField? Does it work for you? If not, please make a pull request with a test.

mitar commented 11 years ago

Closing because no feedback.