On Jul 25, 3:59 pm, "Karen Tracey" <
kmtra...@gmail.com> wrote:
> On Fri, Jul 25, 2008 at 6:42 AM,
alaasal...@gmail.com <
Well, the offending code exists in django-rest-interface and so this
might be a problem there after all. However, i tracked it down to
django itself by using the steps that i outlined above.
I will paste the code, i know its hard to "talk" about code but the
gist of the idea is that the django-rest-interface is deserializing
JSON data with a Foreign key. And then it is trying to create a form
out of the deserialized data and then
trying to validate it by "is_valid"
The culprit code is at
http://dpaste.com/67388/
For some context, create calls get_data, and the request will contain
the JSON data. The JSON data is very simple, mine looks like this:
[{
"pk": 30,
"model": "fmdisplay.weatherstationsample",
"fields": {
"wind_speed": 0.0,
"light_intensity_sensor": 1.0,
"sample_time": "2008-06-24 17:19:25",
"wind_direction": 1.0,
"humidity_sensor": 1.0,
"weather_station": 4,
"temp_sensor": 1.0,
"precepitation_sensor": 1.0
}
}]
The weather_station field here is the one that corresponds to a
foreign key if that helps.
I also understand what you said about plenty of code using this, which
is why i found it strange. At first i assumed it was a django-rest-
interface since that project seems to be abandoned and i am trying to
make it run on trunk. Looking deeply into this, maybe its a newforms
issue...i am not sure.