Re: Html Page rendered when i hit this below url instead of json objects

2017-09-29 Thread Bob Gailer
On Sep 28, 2017 7:31 AM, "Rakhee Menon" wrote: > > Hi Everyone, > > When i hit the url localhost:8000/forms it gives a html page and on the other hand when i do it through the django admin ie > > localhost:8000/admin/forms it gives me the result...What can be the reason??Can anyone help?? Check

Re: Html Page rendered when i hit this below url instead of json objects

2017-09-29 Thread Rakhee Menon
Does anyone know about it??/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to dj

Html Page rendered when i hit this below url instead of json objects

2017-09-28 Thread Rakhee Menon
Hi Everyone, When i hit the url localhost:8000/forms it gives a html page and on the other hand when i do it through the django admin ie localhost:8000/admin/forms it gives me the result...What can be the reason??Can anyone help?? Thank You. Regards, Rakhee Menon -- You received this messa

Re: JSON Objects

2017-09-16 Thread yingi keme
I will check it out, i have just used the third party package jsonpickle. And it was easy to use Thanks a lot Yingi Kem > On 16 Sep 2017, at 11:31 AM, Jani Tiainen wrote: > > Hi > > One of the simplest ways is to use special serializer. At least django-nap > and django-rest-framework do hav

Re: JSON Objects

2017-09-16 Thread Jani Tiainen
Hi One of the simplest ways is to use special serializer. At least django-nap and django-rest-framework do have excellent serializers you can leverage. Django itself also has serializer you can use. https://docs.djangoproject.com/en/1.11/topics/serialization/ 16.9.2017 13.26 "yingi keme" kirjoi

JSON Objects

2017-09-16 Thread yingi keme
Say you have a simple class class Cart(object): def _init_(self, name, age): self.name = name self.age = age And then you have an instance of the class T = Cart('john', 23) How will you serialize the object instance T using json? I know json serializes limited data structur

Re: Best practice for passing JSON objects to a template

2015-04-24 Thread Piper Merriam
Look at django-argonauts https://github.com/fusionbox/django-argonauts It provides a nice (safe) template tag you can use to filter json serializable python objects into safe javascript objects. On Thursday, April 9, 2015 at 11:50:50 AM UTC-6, Eric Plumb wrote: > > Hi Djangoers! > > Sometimes i

Re: Best practice for passing JSON objects to a template

2015-04-24 Thread florent . pastor
I guess both methods are valid. Method one could be useful if it makes sense to have a data attribute. Although, if it makes sense to have a data attribute filled up with JSON, and if the json is simple enough, then you can surely convert the json file to "data-" element (for exemple, {"name" :

Re: Best practice for passing JSON objects to a template

2015-04-22 Thread Mario Gudelj
I often use method 2. I don't see a problem with it. On 10 April 2015 at 02:08, Eric Plumb wrote: > Hi Djangoers! > > Sometimes in the course of human events it becomes necessary to encode a > JSON object directly into a template. We all prefer AJAX and REST APIs and > the rest of the TOFLAs, b

Re: Best practice for passing JSON objects to a template

2015-04-22 Thread Ilya Kazakevich
What about putting it into ? On Thursday, April 9, 2015 at 8:50:50 PM UTC+3, Eric Plumb wrote: > > Hi Djangoers! > > Sometimes in the course of human events it becomes necessary to encode a > JSON object directly into a template. We all prefer AJAX and REST APIs and > the rest of the TOFLAs, bu

Best practice for passing JSON objects to a template

2015-04-09 Thread Eric Plumb
Hi Djangoers! Sometimes in the course of human events it becomes necessary to encode a JSON object directly into a template. We all prefer AJAX and REST APIs and the rest of the TOFLAs, but in the cases where it has to be part of the template, I'm wondering if there's an accepted canonical bes

Re: json objects and PUT/GET Requests/Response

2012-07-24 Thread sanket
blem,I have defined CRUD specific to that of MongoDB in my > Models.py file, now I am trying to pass data to be written into this DB > using http PUT requests. > 1.How parse json objects in the body of HTTP request ? > 2.How to create HTTP put/get request for test purposes with json o

Re: json objects and PUT/GET Requests/Response

2012-07-24 Thread Masklinn
On 2012-07-24, at 21:09 , svs wrote: > Hello, > > I am new to both DJANFGO & REST. > Here is my problem,I have defined CRUD specific to that of MongoDB in my > Models.py file, now I am trying to pass data to be written into this DB > using http PUT requests. > 1.How

json objects and PUT/GET Requests/Response

2012-07-24 Thread svs
Hello, I am new to both DJANFGO & REST. Here is my problem,I have defined CRUD specific to that of MongoDB in my Models.py file, now I am trying to pass data to be written into this DB using http PUT requests. 1.How parse json objects in the body of HTTP request ? 2.How to create HTTP put

Re: Problem sending json objects

2009-07-21 Thread Gustavo Henrique
Thanks, David! I converted to string using: str_obj = '' $.each(obj, function(k, v) { str_cols += '"'+k+'": "'+v+'",'; }); str_obj = '{'+str_obj.slice(0,-1)+'}'; -- Gustavo Henrique Site: http://www.gustavohenrique.net Blog: http://blog.gustavohenrique.net --~--~-~--~~

Re: Problem sending json objects

2009-07-16 Thread djfis...@gmail.com
Gustavo, I believe this is a problem (feature?) of jquery. It is not serializing your full settings object to a string. Instead, it creates a series of url-encoded key value pairs. It looks like it is just calling .toString() on the value side as well. When .toString() is called on: {"id": {"lab

Problem sending json objects

2009-07-16 Thread Gustavo Henrique
Hi list! I'm a problem with json and django. My javascript code send all data by ajax but my view don't accept the content [Object Object] like json object. I try using jquery: settings = { model_name: 'Client', cols: {"id": {"label":"", "width":"10px"}, "name": {"label":"Nome", "