Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
On 19 Jan 2014 00:18, "François Schiettecatte" wrote: > > Hi > > IANA says the JSON mime type be application/json, so you might want to use that. > > application/javascript should be for javascript. Yes thats true. My bad. > > > François > > On Jan 18, 2014, at 12:05 PM, Babatunde Akinyanmi wro

Re: JSON serialization

2014-01-18 Thread François Schiettecatte
Hi IANA says the JSON mime type be application/json, so you might want to use that. application/javascript should be for javascript. François On Jan 18, 2014, at 12:05 PM, Babatunde Akinyanmi wrote: > https://docs.djangoproject.com/en/1.6/ref/request-response/#usage > > Actually, Google is

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
https://docs.djangoproject.com/en/1.6/ref/request-response/#usage Actually, Google is your friend. On 18 Jan 2014 19:48, "Igor Korot" wrote: > Hi, Babatunde, > > On Sat, Jan 18, 2014 at 8:32 AM, Babatunde Akinyanmi > wrote: > > Thats probably because you are returning the json as a context in a

Re: JSON serialization

2014-01-18 Thread Igor Korot
Hi, Babatunde, On Sat, Jan 18, 2014 at 8:32 AM, Babatunde Akinyanmi wrote: > Thats probably because you are returning the json as a context in a response > with the default "text/html" mime type. Your response should have mime type > as " application/javascript". > Your json data should be in the

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
Thats probably because you are returning the json as a context in a response with the default "text/html" mime type. Your response should have mime type as " application/javascript". Your json data should be in the response On 18 Jan 2014 09:16, "Igor Korot" wrote: Hi, guys, On Sat, Jan 18, 2014

Re: JSON serialization

2014-01-18 Thread Igor Korot
Hi, guys, On Sat, Jan 18, 2014 at 12:02 AM, Babatunde Akinyanmi wrote: > > On 18 Jan 2014 08:32, "Mario Gudelj" wrote: >> >> In your template try {{usb_data|safe}} > > ...because django escapes everything in the template by default except > you ask not to. One of the methods of doing so if b

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
On 18 Jan 2014 08:32, "Mario Gudelj" wrote: > > In your template try {{usb_data|safe}} ...because django escapes everything in the template by default except you ask not to. One of the methods of doing so if by using the `safe` filter like Mario suggested. You can read the documentation on ho

Re: JSON serialization

2014-01-17 Thread Mario Gudelj
In your template try {{usb_data|safe}} On 18/01/2014 4:53 pm, "Igor Korot" wrote: > Hi, ALL, > I'd like someone to help me understand this situation. > Looking at the page: > https://docs.djangoproject.com/en/dev/topics/serialization/ the part > which says "Serialization formats->JSON" there is a

JSON serialization

2014-01-17 Thread Igor Korot
Hi, ALL, I'd like someone to help me understand this situation. Looking at the page: https://docs.djangoproject.com/en/dev/topics/serialization/ the part which says "Serialization formats->JSON" there is an example of how the data would be serialized. The sample uses the symbol "double quotation

Re: Json serialization help

2011-08-16 Thread Andre Terra
Thank you a lot for this snippet! I've wondered about how to export objects to excel in a "more natural way" and this seems to be a great approach, considering all the different gotchas. Thank you for taking the time to write this.. I've been postponing this little bit of research for the longest

Re: Json serialization help

2011-08-16 Thread Nate
Thank you for the suggestion. I actually ended up extending Django's json serializer. Here is the code in case you or someone else needs to do something like this. from django.core.serializers.json import Serializer as JsonSerializer from django.utils.encoding import is_protected_type class Displ

Re: Json serialization help

2011-08-14 Thread Landy Chapman
> The response is something like: > 'Content-Type: text/html; charset=utf-8\n\n[{"pk": 1, "model": > "MyApp.foo", "fields": {"choice_field": "db_name1"}}]' This is interesting.. But I think the serializer is working properly. the first element in the tuple is the value stored in the database, and

Json serialization help

2011-08-14 Thread Nate
Hello, I'm new to Django and having a problem with serialization. I am trying to serialize a model that has a CharField with choices, and the json serializer returns json with the choices' database values instead of display values. Is there a way to get the json serializer to use the choices's di

Re: json serialization question

2011-05-27 Thread Ian Clelland
On Tue, May 24, 2011 at 8:36 AM, Sells, Fred wrote: > My code looks like this > > records = models.Residents.objects.extra( where=[], params=[...]) > data = serializers.serialize('json', records, ensure_ascii=False, > fields=('fname','lname', 'pt')) > return HttpResponse(data) > > After experi

json serialization question

2011-05-24 Thread Sells, Fred
I'm using AJAX, jquery and JSON for the first time, having used templates to render XML for Flex/Flash in all my previous Django work. My code looks like this records = models.Residents.objects.extra( where=[], params=[...]) data = serializers.serialize('json', records, ensure_ascii=False, fie

Re: Json serialization for use in JS

2011-05-20 Thread Jonas Geiregat
> > class Serializer(PythonSerializer): > def end_object(self, obj): > self.objects.append({ > "fields" : self._current > }) > self._current = None > > I've made a small mistake I was importing PythonSerializer while It should've been JsonSerializer C

Re: Json serialization for use in JS

2011-05-20 Thread Jonas Geiregat
> > Your idea of overriding the Serializer class sounds like a better idea to me. > It should be possible (and will be interesting) ,I'll think I'll look into > that tonight. Overwriting django's default serializers is possible. This is how I've done it: In the root of my django project: mkd

Re: Json serialization for use in JS

2011-05-20 Thread sebastien piquemal
Hi ! I have written a small library that (among other transformations) can serialize django objects to dict (then you can just use 'json' to make your dict to a json string) : Docs on readthedocs : http://readthedocs.org/docs/any2any/en/latest/doc_pages/djangocast.html Pypi page : http://pypi.py

Re: Json serialization for use in JS

2011-05-19 Thread Tom Evans
On Thu, May 19, 2011 at 1:23 PM, Jonas Geiregat wrote: > Hello, > I'm also finding the built in serialization a bit overhead. Me too! I use a simple HttpResponse subclass for generating JSON though: from django.http import HttpResponse from django.utils import simplejson class JsonResponse(Htt

Re: Json serialization for use in JS

2011-05-19 Thread Jonas Geiregat
Hello, I'm also finding the built in serialization a bit overhead. It puts to much information in your JSON string that can be modified such as the PK field. I often import json ( http://docs.python.org/library/json.html ) and serialize the data myself before passing it to the render method. Th

Json serialization for use in JS

2011-05-19 Thread redfive
I'm trying to return some JSON from one of my views. My objects are simple and I can get the built-in json serializer working, but wanted a cleaner object when I deserialize in my webpage, i.e. I don't want the pk or model entries. What is the best way to go about that? I played around a little wit

Re: How can I control JSON serialization?

2011-02-28 Thread Derek
> > sorry for the confusion. > > Sasha Bolotnovwww.gorizont-zavalen.ru > > On Sun, Feb 27, 2011 at 2:38 AM, Russell Keith-Magee < > > > > > > > > russ...@keith-magee.com> wrote: > > On Sun, Feb 27, 2011 at 5:30 AM, Alexander Bolotnov > > wro

Re: How can I control JSON serialization?

2011-02-26 Thread Alexander Bolotnov
On Sun, Feb 27, 2011 at 2:38 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Sun, Feb 27, 2011 at 5:30 AM, Alexander Bolotnov > wrote: > > Is there a way to control json serialization in django? Simple code below > > will return serialized object in json: &

Re: How can I control JSON serialization?

2011-02-26 Thread Russell Keith-Magee
On Sun, Feb 27, 2011 at 5:30 AM, Alexander Bolotnov wrote: > Is there a way to control json serialization in django? Simple code below > will return serialized object in json: I've just answered this on django-developers. For the record, cross-posting topics like this isn't en

Re: JSON serialization of related records.

2009-09-03 Thread Amir Habibi
Thanks Mike. The issue is the inflexible handling of fk entries of a model by the django serializer or more accurately PythonSerializer. The behavior is inherited by json and xml serializers the same. I've eventually resorted to rewriting the whole serialization to make it a better fit for my aja

Re: JSON serialization of related records.

2009-09-01 Thread Mike Ramirez
On Tuesday 01 September 2009 12:29:56 pm Amir Habibi wrote: > How can I serialize a Queryset along with the related records. For > example, in Poll and Choice case, I need each poll to have the choices > encoded in json format. > > Thanks > you'll want to look at the docs on serialization [1], it

JSON serialization of related records.

2009-09-01 Thread Amir Habibi
How can I serialize a Queryset along with the related records. For example, in Poll and Choice case, I need each poll to have the choices encoded in json format. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: json serialization error on arrays

2009-08-26 Thread John
When I have arrays of 100,000+ the performance of lists gets unacceptable in standard c python. That's why arrays exist in python! After doing research and testing, I have decided to rebuild the project in java with embedded jython. For some bizarre reason jython performance increases with large

Re: json serialization error on arrays

2009-08-25 Thread Peter Bengtsson
what's wrong with turning it into a list? If you gzip it it won't be that big. On Aug 25, 5:16 pm, John Baker wrote: > I need to json serialize some very large objects which include large > arrays. How can I do this in django? The arrays will be very big and > heavily processed before so need to

json serialization error on arrays

2009-08-25 Thread John Baker
I need to json serialize some very large objects which include large arrays. How can I do this in django? The arrays will be very big and heavily processed before so need to use efficient array storage. Testing with arrays I get.. TypeError at /zeros/ array([ 0., 0., 0., 0., 0., 0., 0.,

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
The reason I'm trying it is due to a requirement, the data rather than being sent using a normal post request in a multienc form has to be sent over in a json string in the post request containing the base64 encoded image. On Mon, 2009-08-24 at 18:38 +0200, Maksymus007 wrote: > On Tue, Aug 4, 200

Re: JSON Serialization with ImageField

2009-08-24 Thread Maksymus007
On Tue, Aug 4, 2009 at 10:58 PM, scuzz wrote: > > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django deserialisation > like: > > serializers.deserialize("json", "...snip..., \"myImageField\": > \"base64encodedimage

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
Did you find a way to do this? I'm having the same problem. Lewis On Aug 4, 9:58 pm, scuzz wrote: > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django deserialisation > like: > > serializers.deserialize("json",

JSON Serialization with ImageField

2009-08-04 Thread scuzz
Hi, I'm trying to receive a file encoded in a json string and store it in an ImageField. I was hoping to use the standard Django deserialisation like: serializers.deserialize("json", "...snip..., \"myImageField\": \"base64encodedimage\", ...snip...) however it tries to store the image content s

Re: Json Serialization / Form Validation error

2009-04-02 Thread Bro
But before, is it possible to serialize a form in JSON ? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: Json Serialization / Form Validation error

2009-04-02 Thread Bro
But beforce, is it possible to serialise a form in JSON ? Thanks On 11 fév, 00:50, adrian wrote: > Thank you all for posting this.  You saved me probably hours of head > scratching. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread mattimust...@gmail.com
sn't seem > > like Django does this. > > > I just wanted to get a general consensus on how people are tackling > > this in the real world, really.  I am personally going to probably go > > the route of a custom serializer, probably something like > > this:h

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread mattimust...@gmail.com
neral consensus on how people are tackling > this in the real world, really.  I am personally going to probably go > the route of a custom serializer, probably something like > this:http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for > I have already written a c

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread django_fo...@codechimp.net
Obviously I was tired when I wrote this. I apologize for the grammatical errors, which were a-plenty. On Feb 12, 5:51 pm, Russell Keith-Magee wrote: > On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net > > > > wrote: > > > I wanted to get the communities thoughts on this subject.  I

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread django_fo...@codechimp.net
/wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django. On Feb 12, 5:51 pm, Russell Keith-Magee wrote: > On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net > > > > wrote: > > > I wanted to get the communities thoughts on this subject.  I a

Re: Thoughts on nested Model references and JSON serialization

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net wrote: > > I wanted to get the communities thoughts on this subject. I am > working on a simple site that has news articles, each of which has a > reference to a User object provided by django.contrib.auth that is the > author of the n

Thoughts on nested Model references and JSON serialization

2009-02-12 Thread django_fo...@codechimp.net
I wanted to get the communities thoughts on this subject. I am working on a simple site that has news articles, each of which has a reference to a User object provided by django.contrib.auth that is the author of the news article. This is done right now using the following code: class NewsArtic

Re: Json Serialization / Form Validation error

2009-02-10 Thread adrian
Thank you all for posting this. You saved me probably hours of head scratching. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com

Re: Json Serialization / Form Validation error

2009-01-15 Thread Alex
I ran into this same problem but the code snippets you guys gave weren't working. In case anyone is reading this in the future, here is what you want: dict([(k, [unicode(e) for e in v]) for k,v in errors.items()]) The above line will give a dictionary of field names mapping to lists of errors.

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread mattimust...@gmail.com
On Dec 28, 10:01 am, "Russell Keith-Magee" wrote: > On Sun, Dec 28, 2008 at 5:32 AM, adambossy wrote: > > > Russ, > > > Thanks for the reply. Specifically, I am wondering if there is some > > feature of the Models API that allows me to retrieve the foreign key > > object so that it is included

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread Russell Keith-Magee
On Sun, Dec 28, 2008 at 5:32 AM, adambossy wrote: > > Russ, > > Thanks for the reply. Specifically, I am wondering if there is some > feature of the Models API that allows me to retrieve the foreign key > object so that it is included in the serialized string. That is, > without writing my own se

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread adambossy
Russ, Thanks for the reply. Specifically, I am wondering if there is some feature of the Models API that allows me to retrieve the foreign key object so that it is included in the serialized string. That is, without writing my own serializer (which I suspect I may have to do). Alternatively, I wa

Re: How do I make Django evaluate a ForeignKey for json serialization?

2008-12-27 Thread Russell Keith-Magee
On Sat, Dec 27, 2008 at 2:11 PM, adambossy wrote: > > I have a model that refers to a ForeignKey, e.g.: > > class Template(models.Model): > type = models.ForeignKey(Type) > ... > > class Type(models.Model) > name = models.CharField(max_length=32) > ... > > I can fetch these objects fine using t

How do I make Django evaluate a ForeignKey for json serialization?

2008-12-26 Thread adambossy
I have a model that refers to a ForeignKey, e.g.: class Template(models.Model): type = models.ForeignKey(Type) ... class Type(models.Model) name = models.CharField(max_length=32) ... I can fetch these objects fine using the model API. t = Template.objects.get(id=1) print t.type >> print t

Re: Json Serialization / Form Validation error

2008-12-17 Thread Rodrigue
Hi Russell, I bumped into the same issue today and was glad I found this post. However, I found that I had to use unicode() rather than str(), which turns your example into: content = dict((key, [unicode(v) for v in values]) \ for key, values in form.error

Re: Json Serialization / Form Validation error

2008-10-18 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 12:58 AM, justind <[EMAIL PROTECTED]> wrote: > > Hello, > > No one has any ideas? Settle down, Tiger. You asked this question on a Friday night. You may need to wait a little more than 18 hours if you want a response. We're all volunteers here, and many of us have professi

Re: Json Serialization / Form Validation error

2008-10-18 Thread justind
Actually the test form is (I forgot to change the name) class MyForm(forms.Form): text = forms.CharField() link = forms.URLField() On Oct 18, 4:21 pm, justind <[EMAIL PROTECTED]> wrote: > I get exactly the same thing. > > Here's what I'm entering. > > >>> import simplejson > >>> simple

Re: Json Serialization / Form Validation error

2008-10-18 Thread justind
I get exactly the same thing. Here's what I'm entering. >>> import simplejson >>> simplejson >>> from myproject.app.models import MyForm >>> f = MyForm({'link': 'footext'}) >>> f.errors {'text': [u'This field is required.'], 'link': [u'Enter a valid URL.']} >>> simplejson.dumps(f.errors) Trace

Re: Json Serialization / Form Validation error

2008-10-18 Thread TiNo
Could you try this with simplejson not bundled with Django? If that works this is probably a bug in the version bundled with Django. On Sat, Oct 18, 2008 at 6:58 PM, justind <[EMAIL PROTECTED]> wrote: > > Hello, > > No one has any ideas? > > The code I'm actually using in my view is almost identic

Re: Json Serialization / Form Validation error

2008-10-18 Thread justind
Hello, No one has any ideas? The code I'm actually using in my view is almost identical to the validage_contact view from http://toys.jacobian.org/presentations/2007/oscon/tutorial/ (single slide: http://toys.jacobian.org/presentations/2007/oscon/tutorial/images/django-master-class.081.png) and

Json Serialization / Form Validation error

2008-10-17 Thread [EMAIL PROTECTED]
Hello, I'm having a hard time understanding why Django won't let me serialize a dictionary of form errors. Can anyone explain why Django throws an error if I try to serialize someform.errors, even if I copy it into a plain dictionary? #!/usr/bin/env python from django.utils import simplejson fro

Re: Unicode JSON Serialization Bug?

2007-08-31 Thread mynameisgabe
After doing more searching I ran across this post, claiming that the ensure_ascii argument was worthless and caused the bug. I removed it from the argument list and all is well!! http://groups.google.com/group/django-users/browse_thread/thread/87b1478c02d743e0/e4849fcf74147466?lnk=gst&q=unicode+

Re: Unicode JSON Serialization Bug?

2007-08-31 Thread mynameisgabe
Does anyone have any idea about this one? I'm kind of in a bind on this one. Thanks! Gabe On Aug 30, 2:12 pm, mynameisgabe <[EMAIL PROTECTED]> wrote: > Hello All- > > I've been told that I may have encountered abug- I'm trying to > serialize a model that includes fields that could beunicodedat

Unicode JSON Serialization Bug?

2007-08-30 Thread mynameisgabe
Hello All- I've been told that I may have encountered a bug - I'm trying to serialize a model that includes fields that could be unicode data. Here is the information I collected. Let me know if there's anything else that would be helpful. Specs of the local dev workstation - having the same is

Re: json serialization without certain fields and with extra information?

2007-03-10 Thread shevken
Hey guys, How do you de-serialize the object back at the ajax response. class Cart(models.Model): ... def get_total_quantity(): return quantity; self.response = self.xmlhttp.responseText; // parse the response into a JSON object var json_data = self.response.parseJSON(); alert(jso

Re: json serialization without certain fields and with extra information?

2007-03-04 Thread Manoj Govindan
Hi Bram, Here is a possible mechanism to address your second point, i.e., hide certain fields while serializing. Consider this model: class Person(models.Model): ... # various fields here. @staticmethod def fields_for_serializing(): return [list of those field names that can

Re: json serialization without certain fields and with extra information?

2007-03-01 Thread Bram - Smartelectronix
Manoj Govindan wrote: > > >> The serializer in trunk has a fields option, which only serializes the >> fields supplied. >> >> Ex: >> serializers.serialize('json', my_user_set, fields=('username', 'id')) > > This doesn't work at the moment > http://code.djangoproject.com/ticket/3466 > > But luc

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread Manoj Govindan
> The serializer in trunk has a fields option, which only serializes the > fields supplied. > > Ex: > serializers.serialize('json', my_user_set, fields=('username', 'id')) This doesn't work at the moment http://code.djangoproject.com/ticket/3466 But luckily there is also a patch ;) Regards, M

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread Deryck Hodge
On 2/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > hey everyone, > > > 1. is there any way to serialize models and remove some fields? I.e. I > would like to serialize User for example, but I definitely don't want > the email to be there. > The serializer in trunk has a fields opti

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread limodou
My code will seem like: def _get_data(request, obj): if obj.icon: icon = '' % (obj.get_icon_url(), obj.title) else: icon = '' % obj.title authors = [x.username for x in obj.authors.all()] return ({'id':obj.id, 'icon':icon, 'title':obj.title, 'description':o

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread Bram - Smartelectronix
limodou wrote: > django also uses simplejson to dump python variable, why you want to > avoid it? And I think using simplejson is more flexiable and simple. Because it's more generic and I don't want to recreate what's done in the models... In the end I did it like this: # MODEL --

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread limodou
On 2/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > limodou wrote: > > On 2/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > >> hey everyone, > >> > >> > >> 1. is there any way to serialize models and remove some fields? I.e. I > >> would like to serialize User for example,

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread Bram - Smartelectronix
limodou wrote: > On 2/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: >> hey everyone, >> >> >> 1. is there any way to serialize models and remove some fields? I.e. I >> would like to serialize User for example, but I definitely don't want >> the email to be there. >> >> 2. is there a way

Re: json serialization without certain fields and with extra information?

2007-02-28 Thread limodou
On 2/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > hey everyone, > > > 1. is there any way to serialize models and remove some fields? I.e. I > would like to serialize User for example, but I definitely don't want > the email to be there. > > 2. is there a way to provide "custom" pa

json serialization without certain fields and with extra information?

2007-02-28 Thread Bram - Smartelectronix
hey everyone, 1. is there any way to serialize models and remove some fields? I.e. I would like to serialize User for example, but I definitely don't want the email to be there. 2. is there a way to provide "custom" parts of the serialization? For example, when serializing a Book I would lik

Re: JSON serialization and non-model classes

2006-10-18 Thread Stefán Freyr Stefánsson
rialize("json", data), mimetype="text/_javascript_")Any help would shure be appreciated.Kind regards, Stefan Freyr. -- Forwarded message --From: Waylan Limberg <[EMAIL PROTECTED]>Date: Oct 18, 2006 4:06 PM Subject: Re: JSON serialization and non-model classesTo

Re: JSON serialization and non-model classes

2006-10-18 Thread Waylan Limberg
ing etc). > > So now (finally) to my problem. I'm trying to get this bar chart to update > with AJAX so that the whole page isn't refreshed every other second. For > this I was hoping to use Django's JSON serialization but this is where I'm > running into trouble.

JSON serialization and non-model classes

2006-10-18 Thread Stefán Freyr Stefánsson
d every other second. For this I was hoping to use Django's JSON serialization but this is where I'm running into trouble. I have two model classes. One representing a row in the aforementioned table and another one that represents the database table containing the "summary" inf

Re: json serialization

2006-08-01 Thread Jyrki Pulliainen
2006/7/31, Jyrki Pulliainen <[EMAIL PROTECTED]>: > I filed a ticket for this, see http://code.djangoproject.com/ticket/2460 Json serialization is now fixed in SVN Trunk version -- Jyrki // [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received thi

Re: json serialization

2006-08-01 Thread Jyrki Pulliainen
2006/7/31, Gábor Farkas <[EMAIL PROTECTED]>: > > Jyrki Pulliainen wrote: > > 2006/7/31, Gábor Farkas <[EMAIL PROTECTED]>: > >> > >> datetime.datetime inherits from datetime. > >> > > > > Definetly not > > > > > sorry, of course i meant > > "datetime.datetime inherits from datetime.time" My bad to

Re: json serialization

2006-07-31 Thread Gábor Farkas
Jyrki Pulliainen wrote: > 2006/7/31, Gábor Farkas <[EMAIL PROTECTED]>: >> >> datetime.datetime inherits from datetime. >> > > Definetly not > sorry, of course i meant "datetime.datetime inherits from datetime.time" gabor --~--~-~--~~~---~--~~ You received thi

Re: json serialization

2006-07-31 Thread Jyrki Pulliainen
I filed a ticket for this, see http://code.djangoproject.com/ticket/2460 -- Jyrki // [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: json serialization

2006-07-31 Thread Jyrki Pulliainen
2006/7/31, Gábor Farkas <[EMAIL PROTECTED]>: > > siniy wrote: > > Hi all, > > I've downloaded today a new release of Django and played with json > > serialization. I found that if you use DateTime field the resulting > > json string contains only

Re: json serialization

2006-07-31 Thread Gábor Farkas
siniy wrote: > Hi all, > I've downloaded today a new release of Django and played with json > serialization. I found that if you use DateTime field the resulting > json string contains only date, but not all datetime. So I viewed a > source code of django/core/serializers/js

Re: json serialization

2006-07-31 Thread limodou
On 7/31/06, Jyrki Pulliainen <[EMAIL PROTECTED]> wrote: > > 2006/7/31, siniy <[EMAIL PROTECTED]>: > > I know that isinstance(o, datetime.date) returns "True" even "o" is a > > datetime object. But I don't know - may be it's a python bug? My python > > version 2.4.3 from Ubuntu Dapper. I think you

Re: json serialization

2006-07-31 Thread Jyrki Pulliainen
2006/7/31, siniy <[EMAIL PROTECTED]>: > I know that isinstance(o, datetime.date) returns "True" even "o" is a > datetime object. But I don't know - may be it's a python bug? My python > version 2.4.3 from Ubuntu Dapper. I can confirm this behaviour with Debian Testing's Python 2.3.5 too. -- Jy

json serialization

2006-07-31 Thread siniy
Hi all, I've downloaded today a new release of Django and played with json serialization. I found that if you use DateTime field the resulting json string contains only date, but not all datetime. So I viewed a source code of django/core/serializers/json.py and found that: def default