rence in the way the keys *"participations"* and *"page_views"* of
each object are formatted as opposed to the two new keys *"name"* and *"id"*
that my code added to the individual json response data now in python
object form. The final file *Send_Request_View_C
;re showing.
On Mon, Mar 9, 2015 at 3:35 PM, Henry Versemann
wrote:
> OK here goes. The logic in the routine which I actually doing the
> modification to each individual JSON response looks like this:
>
> if str(objctTyp) == 'user':
> rspnsdata['nam
OK here goes. The logic in the routine which I actually doing the
modification to each individual JSON response looks like this:
if str(objctTyp) == 'user':
rspnsdata['name'] = lstobjct['name']
rspnsdata['id'] = lstobjct
OK here goes. The logic in the routine which is actually doing the
modification to each individual JSON response looks like this:
if str(objctTyp) == 'user':
rspnsdata['name'] = lstobjct['name']
rspnsdata['id'] = lstobjct[&
I print it in my command prompt window right
>>> before sending it back to the client, as part of an HttpResponse. Then when
>>> I try to access some of the data using javascript/jQuery once its
>>> been sent back to the client then some of the "jQuery.parseJSON()"
gt; I try to access some of the data using javascript/jQuery once its
>> been sent back to the client then some of the "jQuery.parseJSON()"
>> statements fail when I try to access the data I've formatted in the view,
>> for my response.
>>
>> So my ne
se. Then when
> I try to access some of the data using javascript/jQuery once its
> been sent back to the client then some of the "jQuery.parseJSON()"
> statements fail when I try to access the data I've formatted in the view,
> for my response.
>
> So my next question is how do
lient, as part of an HttpResponse. Then when
I try to access some of the data using javascript/jQuery once its
been sent back to the client then some of the "jQuery.parseJSON()"
statements fail when I try to access the data I've formatted in the view,
for my response.
So my
I solved it! Sorry, at last I had a bad called to jquery library in my
base.html. I had to check all my project
Thank you for your answers, you have helped me a lot!
El viernes, 20 de febrero de 2015, 21:01:46 (UTC+1), elcaiaimar escribió:
>
> Please, have a look at this tutorial:
> https://www.
Please, have a look at this tutorial:
https://www.youtube.com/watch?v=Pxn5L1qJTAw
Sorry, It's in spanish, but it's what I'm doing. I've tried to put the same
code but it doesn't work because he uses an older version of django.
If you don't want to see all the video, you can see the minute 12:16.
What it sounds like actually is that the OP is not preventing the default
action of the form, so the page is being submitted normally and displaying the
response.
--
DR.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
Hi,
It sounds like you click "submit" and then get a page showing the raw json?
That sounds like it could be a bug in your code. Either the event handler
is not connected, or there's an error. You could try checking "Preserve
Log" in the developer console.
Collin
On Thursday, February 19, 201
What is the actual content of the respose you are getting back from the
server?
On Thu, Feb 19, 2015 at 7:06 PM, elcaiaimar wrote:
> I mean in a correct form. My code doesn't work. It seems like the JS code
> doesn't receive the jsonresponse.
> I get a page with {"status":"True","product_id":p.i
I mean in a correct form. My code doesn't work. It seems like the JS code
doesn't receive the jsonresponse.
I get a page with {"status":"True","product_id":p.id} But this should be
read for the JS code, and if it's True show an alert saying Remove it!
Is there anything wrong in my code?
El jue
What do you mean with "in a good way"? Does your code work?
On Thu, Feb 19, 2015 at 4:14 PM, elcaiaimar wrote:
> Hello,
>
> I was wondering how I can send a response JSON in a good way, because I
> have the next code:
>
> if "product_id" in request.POST:
> try:
> id_p
Hello,
I was wondering how I can send a response JSON in a good way, because I
have the next code:
if "product_id" in request.POST:
try:
id_producto = request.POST['product_id']
p = Pozo.objects.get(pk=id_producto)
mensaje = {"status":"
check out:
http://docs.djangoproject.com/en/1.2/topics/cache/#controlling-cache-using-other-headers
On Feb 20, 7:06 am, Олег Корсак
wrote:
> Hello. I have memcached mw enabled. And I can see that response is
> cached in memcached. I want to stop caching that. How is it possible to
> do? Thanks
>
A quick and dirty way is to append a timestamp to the URL so it's
always unique. That way it won't be cached.
Add "new Date().getTime()" to the end of the URL your AJAX call
requests. Just have your url pattern accept and ignore the extra
stuff.
Shawn
--
You received this message because you ar
Hello. I have memcached mw enabled. And I can see that response is
cached in memcached. I want to stop caching that. How is it possible to
do? Thanks
def do_something(request):
return HttpResponse('yoyoyo23', content_type = 'application/javascript;
charset=utf8')
signature.asc
Descripti
>
>
> The question, how can I return username of user in fields. I want
> the JSON response to contain value user.username instead of id of
> user oject
>
> Thanks,
> Oleg
>
Get everything you want into a dictionary. Then something like this
will give
veList = ActiveList.objects.all()
>
> data = serializers.serialize("json", activeList, fields = (u'user',
> 'status'))
> return HttpResponse(data, mimetype='application/json')
>
> The question, how can I return username of user
ize("json", activeList, fields = (u'user',
'status'))
return HttpResponse(data, mimetype='application/json')
The question, how can I return username of user in fields. I want the JSON
response to contain value user.username instead of id of user oject
Tha
a "best
practice" or convention for returning JSON from Django. My initial
Django view built up a JSON response by looping over the results of a
database query. A friend who uses a different language/framework then
advised that I should avoid building my own JSON responses and
instead re
23 matches
Mail list logo