Django Serialization: ManyToMany Field doesn't input into database

2022-04-12 Thread Jeffrey Ma
The code runs and all fields except the manytomany field is written into the mysql database. I am posting json to the django backend which will be written into the database. For more information:

Re: Overriding Prefetched objects in Serialization

2019-12-27 Thread Integr@te System
0) > in_stock = models.BooleanField() > > > With this Topping model, I can use the Prefetch object: > > pizzas = Pizza.objects.all().prefetch_related( > Prefetch('toppings', queryset=Topping.objects. > filter(in_stock=True) > ) > &

Overriding Prefetched objects in Serialization

2019-12-26 Thread Cesar Bueno
the serialization). But my problem begins when I try to do the same stock control with the Pizza object. Just like I did with Topping, I will also add the in_stock field to the Pizza Model. The new Pizza Model then is: class Pizza(models.Model): name = models.CharField(max_length=50) toppings

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-14 Thread Miika Huusko
hing else would have worked I could have paginated or something similar, but the second is more difficult. The main problem here is the JOIN after `prefetch_related` queries. As the profiling shows something strange happens before serialization and Django is using ridiculous amount of time fo

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Melvyn Sopacua
and offline requirements, why you have setup the API the way you did. Two more thourghts for you: - Use a cacheable dataset and incremental updates to be done "when wifi or better is available". Complex, but worth it in the long run. - Ditch DRF serialization and get the querie

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Alceu Rodrigues de Freitas Junior
I'm guessing here that REST would not be the appropriate to handle "large" amounts of data, and probably that's why Melevyn suggested to use pagination. If your customer needs such data to be used off-line, I bet that would be better to generate a file in the appropriate format, compact it

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
a Huusko wrote: > > I have a performance problem with Django + Django REST Framework. The > problem is that it takes Django very, very long time to handle SQL query > response + DRF serialization take quite some time also. It happens when > there are ManyToMany or OneToMany relations a

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Melvyn Sopacua
On Sunday 11 June 2017 13:41:55 Miika Huusko wrote: > @Melvyn Sopacue, I opt to use prefetch_related because I'm fetching > "Items" that are used as ForeignKey for "Photos" and "Events". > Select_related is meant for cases where you have OneToOne of > ForeignKey relation (single item) that you

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
extra looping or cloning going on when performing Python level JOIN for prefetched Photos or other related sets. On Sunday, June 11, 2017 at 4:57:22 PM UTC+2, Miika Huusko wrote: > > I have a performance problem with Django + Django REST Framework. The > problem is that it takes Django

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Melvyn Sopacua
On Sunday 11 June 2017 09:15:09 Miika Huusko wrote: > Thanks for response! > > Yep, timing with "time" is not the best way to go to compare SQL query > times. The reason I added that "time" test is that in Stack Overflow > I was asked to confirm that data transfer is not factor here. I timed >

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Alceu Rodrigues de Freitas Junior
uot;note_id" IN (349527, 349528, 349529, *... and rest of the 40k IDs ...* ); Quite simple quries. Timing shown in django.db.backends logs is what those queries take when executed manually with psql (1252 ms + 883 ms). That results simple profiling info: Database lookup

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
ng shown in django.db.backends logs is what those queries take when executed manually with psql (1252 ms + 883 ms). That results simple profiling info: Database lookup | 20.4447s Serialization | 3.3821s Django request/response | 0.3419s API view | 0.1988s Re

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Alceu Rodrigues de Freitas Junior
on a Perl related blog, the concepts on the post are applicable everywhere. Em 11/06/2017 07:06, Miika Huusko escreveu: I have a performance problem with Django + Django REST Framework. The problem is that it takes Django very, very long time to handle SQL query response + DRF serialization take

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Alceu Rodrigues de Freitas Junior
see, you want to get 10k to 50k items... that's a lot (to serialize too). Em 11/06/2017 07:06, Miika Huusko escreveu: I have a performance problem with Django + Django REST Framework. The problem is that it takes Django very, very long time to handle SQL query response + DRF serialization take

Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-11 Thread Miika Huusko
I have a performance problem with Django + Django REST Framework. The problem is that it takes Django very, very long time to handle SQL query response + DRF serialization take quite some time also. It happens when there are ManyToMany or OneToMany relations and nested objects. Sounds like &q

Re: Authentication backend - serialization

2017-06-08 Thread Alison P
Hi! Ludovic, Melvyn, thank you for your responses. I could not make Melvyn's example work for me, but it put me on the right track. Solution: right under the "reset the one time password" comment, add the line "user.backend = 'path.to.OneTimePasswordBackend' ", and everything works as it

Re: Authentication backend - serialization

2017-06-05 Thread Melvyn Sopacua
On Monday 05 June 2017 04:14:01 Alison P wrote: > If I use the default session serializer, I get the following error: > TypeError at /login/ > > is not JSON serializable I'm using this is a general solution. Feel free to strike what you don't need. The basics is that a JSONEncoder knows

Re: Authentication backend - serialization

2017-06-05 Thread ludovic coues
I don't see where in your code the error happen. With standard python, you can't add a method on your class to make is JSON serializable. At least to my knowledge. You have to write your own serializer and instruct the code turning your object into JSON to use it. But there are a few easier

Authentication backend - serialization

2017-06-05 Thread Alison P
Hi everyone, I have written a custom authentication backend, the code is below. It allows a user to click "email me a one-time password" on the home page, which is saved on the "Person" model (which extends User through a foreign key) and then log in with that password. This backend verifies

Custom Field Default Value Serialization

2017-03-02 Thread qilin qi
Hi All, Apologize if this question has been asked before. This is my first question into this mailing list. I am creating a custom field(MyCustomField) with a custom value class(MyValue). I do have a deconstruct() method for my *field* class. And I would like to have a default value of this

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
e stuff in your > > >> template. > > > > > > Thank you, guys. It works. > > > Now I need to figure out why I still don't see my data in the jQWidget > > > control (jqxGrid)... > > > > > > Anybody familiar with this library? > > > >

Re: JSON serialization

2014-01-18 Thread François Schiettecatte
nk you, guys. It works. > > Now I need to figure out why I still don't see my data in the jQWidget > > control (jqxGrid)... > > > > Anybody familiar with this library? > > > > Thank you. > >> > >>> > >>> On 18/01/2014 4:53 pm, "

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
n > your > >> template. > > > > Thank you, guys. It works. > > Now I need to figure out why I still don't see my data in the jQWidget > > control (jqxGrid)... > > > > Anybody familiar with this library? > > > > Thank you. > >> >

Re: JSON serialization

2014-01-18 Thread Igor Korot
hank you, guys. It works. > Now I need to figure out why I still don't see my data in the jQWidget > control (jqxGrid)... > > Anybody familiar with this library? > > Thank you. >> >>> >>> On 18/01/2014 4:53 pm, "Igor Korot" <ikoro...@gmail.com> wr

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
works. Now I need to figure out why I still don't see my data in the jQWidget control (jqxGrid)... Anybody familiar with this library? Thank you. > >> >> On 18/01/2014 4:53 pm, "Igor Korot" <ikoro...@gmail.com> wrote: >>> >>> Hi, ALL, >>> I'd li

Re: JSON serialization

2014-01-18 Thread Igor Korot
I still don't see my data in the jQWidget control (jqxGrid)... Anybody familiar with this library? Thank you. > >> >> On 18/01/2014 4:53 pm, "Igor Korot" <ikoro...@gmail.com> wrote: >>> >>> Hi, ALL, >>> I'd like someone to help me understa

Re: JSON serialization

2014-01-18 Thread Babatunde Akinyanmi
rio suggested. You can read the documentation on how to escape or unescape stuff in your template. > > On 18/01/2014 4:53 pm, "Igor Korot" <ikoro...@gmail.com> wrote: >> >> Hi, ALL, >> I'd like someone to help me understand this situation. >> Looking at

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" <ikoro...@gmail.com> 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

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 s

Re: Dumpdata and serialization issues

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 1:13, natasha.ba...@utoronto.ca wrote: > On Tuesday, July 3, 2012 5:55:32 PM UTC-4, ke1g wrote: >> >> In fact, I think dumpdata takes an app name, not a table or model name. No it doesn't. It can take a app.model name as well and is more commonly used, since the primary use case for

Re: Dumpdata and serialization issues

2012-07-03 Thread natasha.ba...@utoronto.ca
Hm, I think the functionality to do this -- at least if I understand correctly what I read here: http://stackoverflow.com/questions/1113096/django-dump-data-for-a-single-model I'd be fine dumping the data for the entire app -- but the reason I did it this way is because when I do this, the

Re: Dumpdata and serialization issues

2012-07-03 Thread Bill Freeman
In fact, I think dumpdata takes an app name, not a table or model name. On Tue, Jul 3, 2012 at 5:54 PM, Bill Freeman wrote: > I think that you have to dumdata one or both of the models at the ends > of the many to many, > and the join table will come along for free. > > On

Re: Dumpdata and serialization issues

2012-07-03 Thread Bill Freeman
I think that you have to dumdata one or both of the models at the ends of the many to many, and the join table will come along for free. On Tue, Jul 3, 2012 at 3:21 PM, natasha.ba...@utoronto.ca wrote: > Hi All, > > I'm trying to dump the contents of a table which is

Dumpdata and serialization issues

2012-07-03 Thread natasha.ba...@utoronto.ca
Hi All, I'm trying to dump the contents of a table which is the mapping for a many-to-many field. The table is called Part and it has a ManytoManyField called category_id. When I run python manage.py dumpdata store.part_category_id > file.json I get the error Error: Unable to serialize

Re: De-serialization of ManyToManyField

2012-03-28 Thread sk
bles in question): > > > --- > > - fields: {date: 2012-03-26, name: test 1} > >   model: TempDB.test > >   pk: 1 > > - fields: {date: 2012-03-26, name: test 2} > >   model: TempDB.test > >   pk: 2 > &g

Re: De-serialization of ManyToManyField

2012-03-27 Thread sk
  pk: 1 > --- > > This is roughly what I would expect to see, although the documentation > does not explicitly state that a manytomany serialization will be a > multi-element list, it seems to be a reasonable assumption. > >

De-serialization of ManyToManyField

2012-03-26 Thread sk
, although the documentation does not explicitly state that a manytomany serialization will be a multi-element list, it seems to be a reasonable assumption. When I try to perform a loaddata with this output (and after manually deleting the tables from the admin interface, to be sure). I get

Re: serialization in Django

2012-03-07 Thread Rafael Durán Castañeda
On 03/06/2012 09:52 PM, shiji bijo wrote: ok I have removed the json.dumps() now the view is def do_GET(self, offset): data=get_object_or_404(NewAuction,pk=offset) context=serializers.serialize("json",[data]) return render_to_response("index.html",{"context":context})

Re: serialization in Django

2012-03-06 Thread shiji bijo
ok I have removed the json.dumps() now the view is def do_GET(self, offset): data=get_object_or_404(NewAuction,pk=offset) context=serializers.serialize("json",[data]) return render_to_response("index.html",{"context":context}) and my index.html is {% extends 'base.html'

Re: serialization in Django

2012-03-06 Thread Daniel Roseman
On Tuesday, 6 March 2012 19:14:55 UTC, angel wrote: > > I am new to django and doing my course project. I am searching for a > solution for iterating JSON dictionary in html page. My django view > is the following: > > def do_GET(self, offset): >

Re: serialization in Django

2012-03-06 Thread shiji bijo
thanks for the reply. In our course project it is a requirement to use serialised data for CRUD and display it on the html page.But we are not allowed to use the REST frameworks.I tried using return Httpresponse(serialiseddata). But i dont know where to write the javascript code On Tue, Mar 6,

Re: serialization in Django

2012-03-06 Thread Ilian Iliev
If you are returning json it seems more proper to me to parse it using JavaScript. Why exactly do you return json but not a normal dict/object? -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Mar 6, 2012 at 9:14 PM, angel

serialization in Django

2012-03-06 Thread angel
I am new to django and doing my course project. I am searching for a solution for iterating JSON dictionary in html page. My django view is the following: def do_GET(self, offset): data=get_object_or_404(NewAuction,pk=offset) context=serializers.serialize("json",[data])

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

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

Re: Nested serialization of model instances

2011-08-15 Thread Russell Keith-Magee
On Mon, Aug 15, 2011 at 5:58 PM, Christo Buschek <cr...@30loops.net> wrote: > Hi list, > > I'm busy writing a custom json serializer for django. It works very > good, only now I want to serialize ForeignKey and M2M relations inside > the same serialization call and buil

Nested serialization of model instances

2011-08-15 Thread Christo Buschek
Hi list, I'm busy writing a custom json serializer for django. It works very good, only now I want to serialize ForeignKey and M2M relations inside the same serialization call and build nested json objects with all model instances that the current model instance relates to. {'field_a': 'value

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,

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

multi-page, non-sequential, dynamic forms with serialization/deserialization

2011-06-14 Thread Michael Wayne Goodman
difficult to maintain. We need the following features: * large, multi-page form (too many fields to fit on one page) * dynamic forms (ability to add more fields on demand) * non-sequential entry (users can jump back and forth filling it in) * serialization (the serialized output is sent

Re: json serialization question

2011-05-27 Thread Ian Clelland
ta, or into database fixtures, and they are really designed to be read by the deserializers when the object needs to be reconstructed. If you are passing data from Django to a browser's JavaScript thread using JSON, then you probably want to either 1. Use an API framework, such as Piston (google: djang

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

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:

Re: Json serialization for use in JS

2011-05-20 Thread sebastien piquemal
; 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(HttpResponse): >   def _

Re: Json serialization for use in JS

2011-05-19 Thread Tom Evans
On Thu, May 19, 2011 at 1:23 PM, Jonas Geiregat <jo...@geiregat.org> 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 impor

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

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

Re: How can I control JSON serialization?

2011-02-28 Thread Derek
olotnov <abolot...@gmail.com> > > 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

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 <abolot...@gmail.com> > wrote: > > Is there a way to control json serialization in django? Simple code below > > will return seria

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 <abolot...@gmail.com> 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 lik

Few words about serialization roboustness and django app served via fcgi and nginx connected over unix or tcp socket

2011-02-16 Thread gro...@sq9mev.info
Hi there ;). Yesterday i noticed some strange behaviour of one of my sites - view [1] serving json serialized data (one model, no references, 130 objects) was executed about 20 secs[3] in production environment [2], and less than 1s via development server. Strange thing. What I've found - the view

Re: Complex serialization from models

2010-12-21 Thread Dan Fairs
On 21 Dec 2010, at 12:19, gregory semah wrote: > Nobody has a quick answer ? > Take a look at Django's natural key support - it allows you to control what's serialized for fk references. Cheers, Dan > On Dec 20, 4:11 pm, gregory semah wrote: >> Hi all, >> >> I'm

Re: Complex serialization from models

2010-12-21 Thread Konrad Delong
On 21 December 2010 13:19, gregory semah wrote: > Nobody has a quick answer ? > It looks like xml serialisation wasn't designed to be customisable in the way you need. If I were you, I'd look around the code and see what I could reuse from there. Konrad > On Dec 20,

Re: Complex serialization from models

2010-12-21 Thread gregory semah
Nobody has a quick answer ? On Dec 20, 4:11 pm, gregory semah wrote: > Hi all, > > I'm searching a simple way to generate xml from my models, and a > simple use of serializers can do this for me. > But my models are defined with ForeignKey and ManyToManyField... > The

Complex serialization from models

2010-12-20 Thread gregory semah
Hi all, I'm searching a simple way to generate xml from my models, and a simple use of serializers can do this for me. But my models are defined with ForeignKey and ManyToManyField... The xml generated shows me only key values of these field. Is there a simple way to catch any other field value

for httplib2, serialization or singleton?

2010-07-29 Thread yifan
I got a django web app where there is a httplib2 object used to do HTTPS with client authentication connections to a apache server. The problem is that for every request, my httplib2 object has to do a SSL hand-shaking to apache, which is extremely slow. I tried to save the httplib2 to the

Re: An idea for a serialization framework

2010-06-23 Thread Andy Kelley
on't " translates into > "don'" > > Anyways, I think this idea has merit - even alongside a role-based > security system. > > Feedback? > > On Jun 23, 3:29 am, Andy Kelley <superjo...@gmail.com> wrote: > > > I am coming up with a framework that help

Re: An idea for a serialization framework

2010-06-23 Thread Andy Kelley
.@gmail.com> wrote: > I am coming up with a framework that helps serialization of models. My > idea is for each field to have a view permissions level: PUBLIC, > OWNER, or ADMIN. I want to have a model to dict function that takes 2 > arguments, permission_level and serialize_chain.

An idea for a serialization framework

2010-06-23 Thread Andy Kelley
I am coming up with a framework that helps serialization of models. My idea is for each field to have a view permissions level: PUBLIC, OWNER, or ADMIN. I want to have a model to dict function that takes 2 arguments, permission_level and serialize_chain. Firstly, let me explain how it would change

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-25 Thread h-k-ii
pen a ticket describing the aspect that you > think needs to be improved (which is the list you've just given). > > Addressing your list specifically: > > > 1. mention requirement to use tuple also in serialization section > > (currently this is only mentioned in deseri

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
to suggestions on how to improve documentation. The best way to do this is to open a ticket describing the aspect that you think needs to be improved (which is the list you've just given). Addressing your list specifically: > 1. mention requirement to use tuple also in serialization section > (curre

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread h-k-ii
You are correct. Based on my experience with natural keys, I would propose improvements for the documentation [1] - but perhaps these are matters of personal opinion: 1. mention requirement to use tuple also in serialization section (currently this is only mentioned in deserialization) 2. rename

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
On Fri, Apr 16, 2010 at 5:26 PM, h-k-ii wrote: > I find dumpdata output in XML format quite strange for natural keys. > Each character in a key reference is wrapped in a . > > Is this a bug to be reported or a feature? It certainly doesn't look right; so there is a bug

Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread h-k-ii
I find dumpdata output in XML format quite strange for natural keys. Each character in a key reference is wrapped in a . Is this a bug to be reported or a feature? * >python manage.py dumpdata --format xml --natural appname ... Doctype1 ... D o c t y

Re: Need help in serialization of objects.

2010-02-24 Thread chiranjeevi muttoju
lizer.py > > …and then declare it in the SERIALIZATION_MODULES setting. > > On Feb 24, 7:00 am, chiranjeevi muttoju > <chiranjeevi.mutt...@gmail.com> wrote: > > Hi all, > > I want to convert the model object to xml data. i used the django > > serialization for that. then i'm getting

Re: Need help in serialization of objects.

2010-02-23 Thread Oliver Beattie
xml data. i used the django > serialization for that. then i'm getting the xml data as shown in bellow. > But my aim to remove the "" tag or replacing > that tag by other name. is there is any way to achieve that one. If anybody > know please help me. > > > >

Need help in serialization of objects.

2010-02-23 Thread chiranjeevi muttoju
Hi all, I want to convert the model object to xml data. i used the django serialization for that. then i'm getting the xml data as shown in bellow. But my aim to remove the "" tag or replacing that tag by other name. is there is any way to achieve that one. If anybody know plea

Re: serialization formats?

2009-09-23 Thread Russell Keith-Magee
On Wed, Sep 23, 2009 at 10:38 PM, Chris Withers <ch...@simplistix.co.uk> wrote: > > Hi All, > > Where can I find docs on the actual serialisation formats used by > Django's serialisation support? > > http://docs.djangoproject.com/en/dev/topics/serialization/#id1 >

serialization formats?

2009-09-23 Thread Chris Withers
Hi All, Where can I find docs on the actual serialisation formats used by Django's serialisation support? http://docs.djangoproject.com/en/dev/topics/serialization/#id1 ...lists them, but doesn't actually describe them :-S cheers, Chris -- Simplistix - Content Management, Batch Processing

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

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 o

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

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

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,

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...,

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: > >

Converting some objects during serialization

2009-08-05 Thread Parag Shah
, 2009 4:12' One way to do this is to accept whatever String Django generates and then parse it in Javascript to display what I want to display. Another way is to get the desired format in the serialized JSON String. Is it possible to control the serialization process to change some data as it is being

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

Re: XML serialization and Unicode

2009-07-29 Thread l5x
Hello, On 29 Lip, 15:56, cootetom wrote: > To add, something just popped into my head. Have you got > DEFAULT_CHARSET = 'utf-8' in your settings.py fiile It didn't help. > On Jul 29, 2:51 pm, cootetom wrote: > > > I would imagine that the deserialize

Re: XML serialization and Unicode

2009-07-29 Thread cootetom
dom.py", line 265, in getEvent > >     self.parser.feed(buf) > >   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed > >     self._parser.Parse(data, isFinal) > > UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in >

Re: XML serialization and Unicode

2009-07-29 Thread cootetom
gt;     self.parser.feed(buf) >   File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed >     self._parser.Parse(data, isFinal) > UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in > position 154: ordinal not in range(128) > > I use latest

XML serialization and Unicode

2009-07-29 Thread l5x
rse(data, isFinal) UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in position 154: ordinal not in range(128) I use latest SVN version (1.1) revision 11367. I have # -*- coding: utf-8 -*- line at the beginning of the file, and __unicode__ method is set on the model, which I ser

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

Re: JSON Model Serialization

2009-03-30 Thread Mateusz Wawrzyniak
On Mar 24, 11:05 am, gchuyun wrote: > i tried this, but get a error similar. > > TypeError: [{'publish_time': datetime.datetime(2009, 3, 24, 16, 16, > 18), 'is_deleted': 0, 'is_confirmed' > : 0, 'title': u'1', 'content': u'111', 'id': 1L}, {'publish_time': >

Re: JSON Model Serialization

2009-03-24 Thread gchuyun
ple = Person.objects.all() > > Why don't you use Person.objects.values()? > You will get a list of dicts so there won't be any problems with > serialization. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Django Serialization of BooleanField inconsistent?

2009-03-23 Thread chefsmart
olean values, which is what I want. > > > However, when I do an HTTP PUT to update an instance of a model, the > > xml response has True or False for Boolean values. > > > Though I'm using django-rest-interface, the de/serialization is > > handled by Django itself. &g

Re: Django Serialization of BooleanField inconsistent?

2009-03-23 Thread Karen Tracey
e) the xml > returned has 1 or 0 for Boolean values, which is what I want. > > However, when I do an HTTP PUT to update an instance of a model, the > xml response has True or False for Boolean values. > > Though I'm using django-rest-interface, the de/serialization is > handled

  1   2   3   >