{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/d9cdf9d9857c1064b77ae6ac8cd03dfd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d9cdf9d9857c1064b77ae6ac8cd03dfd","url":"https://api.github.com/users/klipstein","login":"klipstein","id":158866},"milestone":null,"labels":[],"updated_at":"2011-11-06T12:58:10Z","assignee":null,"comments":0,"closed_at":null,"url":"https://api.github.com/repos/klipstein/dojango/issues/41","body":"<pre>\n<b>What steps will reproduce the problem?</b>\nNormal usage of datagrid fails when trying to use Django 1.2 Beta\r\n\r\n<b>What is the expected output? What do you see instead?</b>\nThe grid appears on the form without any data, instead this message:\r\n&quot;Sorry, an error occurred&quot;\r\n\r\nUsing the django testserver, this output is shown:\r\n&quot;===============Exception=============\r\n&lt;django.db.models.base.ModelState object at 0xa717dec&gt; is not JSON serializable\r\n\r\n{'numRows': 80, 'items': [{'init_type': None, 'clone_id': 2962L, '_state':\r\n&lt;django.db.models.base.ModelState object at 0xa717dec&gt;, \r\n...&quot;\r\n\r\nWhat version of the product are you using? \r\ndojango 0.4.6, django 1.4.1\r\nOn what operating system?\r\nubuntu 9.10\r\n\r\n\r\n<b>Please provide any additional information below.</b>\nAfter some investigation, and hacking I could bypass this problem by\r\nchanging the dojango/views.py\r\nand force it to omit the &quot;_state&quot; field from the data.\r\nIf a foreign key is in the model, then the foreign key object can not be in\r\nthe field list, because it also contains a &quot;_state&quot; field.\r\n\r\nBut my hack just proofs the  point that is stated in the summary of this issue:\r\ndojango datagrid fails in Django 1.2 because new field &quot;_state&quot; of type\r\n&lt;django.db.models.base.ModelState&gt; is not JSON serializable\r\nIt needs a proper fix.\r\n\r\nI attach the hacked views.py\r\n\n</pre></br>Original link: http://code.google.com/p/dojango/issues/detail?id=41","html_url":"https://github.com/klipstein/dojango/issues/41","number":41,"title":"41 - dojango datagrid fails in Django 1.2 because new field \"_state\" of type <django.db.models.base.ModelState> is not JSON serializable ","id":2155969,"created_at":"2011-11-06T12:58:10Z"},"action":"opened"}