bigobony: Your urls should have /$ that points to views (that is convention at least). also, why you do have *args and **kwargs in your view?
bigobony: ah, you do have "url" there. You don't pass in url parameter in your view at all.
bigobony
how I need to pass that
quenode has quit
jtiai
bigobony: Depends what are you trying to do?
VaticanCameos joined the channel
quenode joined the channel
VaticanCameos
In Django's form clean() method, am I right in thinking that `cleaned_data` refers to data that has been cleaned by the individual clean_<fieldname> methods and `data` is the raw data that was submitted to the form? What's the difference between the two? Ultimately everything ends up in `cleaned_data`, right?
Audioburn
how do i debug ajax request functions (API functions)
All I get is a 500 error
no error message
bigobony
jtiai, I just don't want to repeat the code so I have passed url as argument and the url is different
jtiai
Audioburn: You do get error message.
Audioburn
where?
jtiai
bigobony: Can you give an example of url you're passing to django?
kevin-brown has quit
Audioburn: if you have DEBUG=True django returns it in the response. You need to check it either using browser debuggin tools or reading actual response text.
kevin-brown joined the channel
ojii has quit
VaticanCameos: cleaned_data is validated and coerced to correct type of data.
bigobony: Ah. Django doesn't handle query parameters with url config. You can access them using request.GET or request.POST
dcrouch joined the channel
VaticanCameos
jtiai: So if the situation demands, I can extract data from `data` instead of `cleaned_data` (fields that don't have any individual clean methods for instance).
jtiai
VaticanCameos: Never. Only cleaned_data is reliable.
bePolite joined the channel
VaticanCameos
jtiai: So there is no situation that could remotely even require the use of `data`?
VaticanCameos: Only when you're creating new form fields.
bigobony
but the code is repeated I don't want that
jtiai
bigobony: What code?
dethos joined the channel
bigobony: Why you need to repeat it?
bigobony
url is different in each function
jtiai
bigobony: different,... how?
VaticanCameos
jtiai: We used tastypie to build a RESTful API. The particular model in question has a resource whose validation is done via the defined form. Apparently tastypie creates model objects before passing data through form validation. I'm led to believe that is causing an issue.
bigobony
Networkid is different
jtiai
VaticanCameos: Ah. Never ussed tastypie since it's awful.
VaticanCameos
The text field's data vanishes by the time program control enters clean().
jessamynsmith
I liked tastypie but it's not really maintained now
jtiai
bigobony: Where that netowrk id comes from?
bigobony
from api
VaticanCameos
jtiai: Well, tastypie was popular 2 years ago. I wasnt working here back then. I doubt anyone will listen if I ask to push to DRF instead. it's way too big a task.