mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 15:40:58 +00:00
1 line
4.8 KiB
JSON
1 line
4.8 KiB
JSON
[{"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305406150.230685, "message": "this is the location model: http://dpaste.com/542542/", "group_id": 81, "id": 1054633}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305406112.496233, "message": "Hi! I've this django view code: http://dpaste.com/542539/", "group_id": 81, "id": 1054630}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305406117.520967, "message": " and this model: http://dpaste.com/542540/ ", "group_id": 81, "id": 1054631}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305406119.7126989, "message": "This is the response: http://dpaste.com/542541/", "group_id": 81, "id": 1054632}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305406162.378829, "message": "why don't I get the location name in the json?", "group_id": 81, "id": 1054635}, {"user_id": 17897, "stars": [], "topic_id": 35316, "date_created": 1305407824.6837201, "message": "from the docs: \"Note that, by default, select_related() does not follow foreign keys that have null=True.\". http://docs.djangoproject.com/en/1.3/ref/models/querysets/#select-related", "group_id": 81, "id": 1054869}, {"user_id": 17897, "stars": [], "topic_id": 35316, "date_created": 1305407853.0904961, "message": "that took like all of 30 seconds to find out. :)", "group_id": 81, "id": 1054879}, {"user_id": 141, "stars": [], "topic_id": 35316, "date_created": 1305414074.485862, "message": "hmm, but that's if the foreign key is null=True. wouldn't that mean:", "group_id": 81, "id": 1056069}, {"user_id": 141, "stars": [], "topic_id": 35316, "date_created": 1305414435.6731551, "message": "this ticket confirms that not following into objects is the expected behavior of the current design: http://code.djangoproject.com/ticket/4656", "group_id": 81, "id": 1056116}, {"user_id": 141, "stars": [], "topic_id": 35316, "date_created": 1305414080.3590579, "message": "class Report(models.Model):\n location = models.ForeignKey(Location, null=True)\n", "group_id": 81, "id": 1056071}, {"user_id": 141, "stars": [], "topic_id": 35316, "date_created": 1305414216.3484731, "message": "from the SO questions i get googling \u201cdjango serializer select_related\u201d it seems to be more what the serializer docs say wrt multi-table inherited models and aside when discussing natural keys http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys which is that the serializers only serialize PKs.", "group_id": 81, "id": 1056084}, {"user_id": 141, "stars": [], "topic_id": 35316, "date_created": 1305414358.446593, "message": "select_related() is a hint when the QuerySet is evaluated, but maybe the serializer deals with the QuerySet itself, so select_related() doesn't affect the serializer.", "group_id": 81, "id": 1056103}, {"user_id": 141, "stars": [{"date_created": 1305447339.165401, "user_id": 21209}, {"date_created": 1305688575.775311, "user_id": 12712}], "topic_id": 35316, "date_created": 1305414621.5270989, "message": "so to do it now you'd have to use an alternate serializer that follows foreign key relationships. that worked for the guy answering this question (the third SO question in the google results): http://stackoverflow.com/questions/3753359/serializing-foreign-key-objects-in-django", "group_id": 81, "id": 1056148}, {"user_id": 31912, "stars": [], "topic_id": 35316, "date_created": 1305439668.4744589, "message": "Report.objects.select_related('location').all() should include the data from the related field.", "group_id": 81, "id": 1057969}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305447395.2873981, "message": "@jschrewe no, it doesn't :(", "group_id": 81, "id": 1058516}, {"user_id": 21209, "stars": [{"date_created": 1306257657.948873, "user_id": 141}], "topic_id": 35316, "date_created": 1305447426.7201221, "message": "@markpasc thank you very much I'll try DjangoFullSerializer :)", "group_id": 81, "id": 1058521}, {"user_id": 17897, "stars": [{"date_created": 1306257661.2492731, "user_id": 141}], "topic_id": 35316, "date_created": 1305455969.4053459, "message": "@patrick91 sorry, I was caught off guard by the null=True on the CharField. #fail :)", "group_id": 81, "id": 1059018}, {"user_id": 17897, "stars": [], "topic_id": 35316, "date_created": 1305455978.9757681, "message": "in the location model", "group_id": 81, "id": 1059019}, {"user_id": 1677, "stars": [{"date_created": 1305688536.3522711, "user_id": 12712}, {"date_created": 1306257666.152864, "user_id": 141}], "topic_id": 35316, "date_created": 1305613405.92364, "message": "Yes-- I use http://code.google.com/p/wadofstuff/wiki/DjangoFullSerializers, too for many things of this nature", "group_id": 81, "id": 1079422}, {"user_id": 21209, "stars": [], "topic_id": 35316, "date_created": 1305812333.5407569, "message": "@adsworth no problem, thanks anyway :)", "group_id": 81, "id": 1111213}] |