Saving data from a post request using nested DRF serializers

2023-04-26 Thread Kimanxo
Here is my problem im gelreat details : https://stackoverflow.com/questions/76112118/django-rest-frameworks-nested-serializers-post-request-foreignkey-error -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

drf serializers

2023-02-24 Thread Chelsea Fan
how to count manytomany field items in serializers.py? -- 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 view this di

Django Rest Framework with self nested serializers

2022-04-26 Thread Sencer Hamarat
Hello people, There are two models that are related to each other. class Parent(models.Model): name = models.CharField... class Child(models.Model): parent = models.ForeignKey(Parent) value = models.CharField... And there is a serializer built on "Child" model: class ChildSerialize

Queries vs Serializers

2020-09-15 Thread Gs_1001
Hey, I previously worked with an organization which had it's back-end implemented using Django. The developers there with did not use the serializers most of the time, I think i must mention that the code base had evolved for the past 4-5 years and the data requested in the APIs was

Re: using serializers with POST requests

2020-06-25 Thread maninder singh Kumar
Seems like the loop doesn't go anywhere but the "else" part where it says fail. Perhaps you need to relook keyword or positional arguments Maninder Kumar about.me/m

using serializers with POST requests

2020-06-24 Thread Arpana Mehta
https://stackoverflow.com/questions/62561906/django-adding-a-new-row-in-a-table-based-on-a-foreign-key-value-using-serializ Please visit this link!! I have posted my question with details there. It's super urgent. -- You received this message because you are subscribed to the Google Groups "D

Convert base64 into zipfile in django serializers

2020-04-30 Thread yashwanth balanagu
Convert base64 into zipfile in django serializers -- 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

Re: serializers

2018-04-09 Thread Avraham Serour
Can you phrase the question better? The way it is written makes it hard to understand exactly what you need here. On Thu, Apr 5, 2018 at 5:33 PM, siva.gatti wrote: > how to add created_by_id to serializers in django rest rest frame work and > created_by_id is stored in session when the u

serializers

2018-04-05 Thread siva.gatti
how to add created_by_id to serializers in django rest rest frame work and created_by_id is stored in session when the user is logged in -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Serializers and forms

2017-03-16 Thread Luvpreet Singh
What is the difference in saving model instance to database using a form and doing the same by using a serializer ? What is the basic need of serializers ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Writable Nested Serializers

2016-01-15 Thread Ashish Gupta
I am trying to use Writable Nested Serializer <http://www.django-rest-framework.org/api-guide/relations/#writable-nested-serializers> with AngularJS. I have image field in the related model. So its something like this: class TrackSerializer(serializers.ModelSerializer): clas

JSON serializers not workinf for some of subset of fields.

2016-01-05 Thread sonu kumar
cities = serializers.serialize("json", country.city_set.all(), fields=('name', 'id')) In this it should JSON object with only name and id field but it returns [{"fields": {"name": "Chennai"}, "model": "job.city", "pk": 1}] where as it should return [{"name": "Chennai", "id": 1}]. How to fix

Re: Multiple serializers

2015-12-14 Thread Mandeep Tondak
ou. >> >> >> El jueves, 10 de diciembre de 2015, 19:27:26 (UTC+1), miguel angel lopez >> mendo escribió: >>> >>> i have this serializers >>> >>> class ValuarCoche(serializers.ModelSerializer): >>> class Meta: >>> mo

Re: Multiple serializers

2015-12-14 Thread Bruno A.
se, put the code in a proper format way or pastebin, and say the > version you are using both Django and DRF > in order other people can answer you. > > > El jueves, 10 de diciembre de 2015, 19:27:26 (UTC+1), miguel angel lopez > mendo escribió: >>

Re: Multiple serializers

2015-12-11 Thread Daniel Chimeno
e can answer you. El jueves, 10 de diciembre de 2015, 19:27:26 (UTC+1), miguel angel lopez mendo escribió: > > i have this serializers > > class ValuarCoche(serializers.ModelSerializer): > class Meta: > model = Valuacion > depth = 6 > fields = ('coche','Pr

Re: Multiple serializers

2015-12-11 Thread miguel angel lopez mendo
any ? El jueves, 10 de diciembre de 2015, 12:27:26 (UTC-6), miguel angel lopez mendo escribió: > > i have this serializers > > class ValuarCoche(serializers.ModelSerializer): > class Meta: > model = Valuacion > depth = 6 > fields = ('coche','P

Multiple serializers

2015-12-10 Thread miguel angel lopez mendo
i have this serializers class ValuarCoche(serializers.ModelSerializer): class Meta: model = Valuacion depth = 6 fields = ('coche','Precio_Venta','Precio_Compra') class CocheSerializer2(serializers.ModelSerializer): valuacion = ValuarCoche(many=True) class Meta:

Re: django dynamic serializers

2015-07-09 Thread Shekar Tippur
James, Thanks for the response. The data is latter. I dont know the structure of incoming message. It can be a simple json or a nested json. I dont have a persistance store. I have a pipeline where a random json comes in and I would like to model the pipeline based on its structure. I need to r

Re: django dynamic serializers

2015-07-09 Thread James Schneider
When you mention dynamic, do you mean that the data has a known set of possible fields, but may only populate a subset of them? Or will it just have random fields that you may not know about ahead of time? If you have a way to articulate all of the possible fields that the data source may use, then

django dynamic serializers

2015-07-09 Thread Shekar Tippur
Hello, I have a source of data that can have a dynamic json structure. Is there a way to dynamically create models based on this? - Shekar -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

NoReverseMatch error and serializers

2012-05-20 Thread .
Hello, I have two local repos. The only difference between them is their DBs. I'm trying to copy some tables from one DB to another via XML-RPC and serializers. I call my XML-RPC method from the shell. It returns a str (serializer). Then I'm trying to deserialize that string:

Re: ANN : any2any, serializers & deserializers for Django

2011-05-07 Thread sebastien piquemal
and deserializations for ldap ... so I decided to > abstract those operations in one library that would simplify writing > casts from one Python type to another. > > And guess what !? It contains cool Django serializers/deserializers > which : > >     - supports MTI nicely >  

ANN : any2any, serializers & deserializers for Django

2011-05-06 Thread sebastien piquemal
contains cool Django serializers/deserializers which : - supports MTI nicely - serializes/deserializes foreign keys and many2many fields nicely - deep serialization and deserialization - natural keys - include/exclude a subset of fields - virtual attributes - very very easy to

how to make serializers work with db.Model

2009-04-07 Thread Coonay
Background: code on google app engine using django framework, i persist data into google data store(which is not a dbms),there is an error of "django AttributeError:object has no attribute '_meta'" when reading the queryset and decoding the queryset using dja

Re: Django serializers and local/inherited model fields

2008-12-30 Thread Russell Keith-Magee
On Wed, Dec 31, 2008 at 4:27 AM, psj wrote: > > Django's base serializers only serialize a model's local fields, not > inherited ones, which seems odd at first blush (if an Employee is a > Person, and a Person has a name, wouldn't I be likely to want to see > t

Django serializers and local/inherited model fields

2008-12-30 Thread psj
Django's base serializers only serialize a model's local fields, not inherited ones, which seems odd at first blush (if an Employee is a Person, and a Person has a name, wouldn't I be likely to want to see the Employees' names by default?) This looks straightforward to w

Re: Single-object serializers?

2007-08-09 Thread Russell Keith-Magee
On 8/9/07, Shawn Allen <[EMAIL PROTECTED]> wrote: > > Hey everyone, > > I'm about to tackle an API that supports multiple response formats > using serializers. I realize that the API (as simple as it is) is > subject to change, but it seems like a totally sensible p

Re: Single-object serializers?

2007-08-08 Thread Shawn Allen
Sorry... after reading that back to myself, I realize that the first sentence might be a little confusing: Just to clarify: I'm *building* an API that will output XML and JSON using Django serializers. I realize that the Django serialization API is subject to change. On Aug 8, 2007,

Single-object serializers?

2007-08-08 Thread Shawn Allen
Hey everyone, I'm about to tackle an API that supports multiple response formats using serializers. I realize that the API (as simple as it is) is subject to change, but it seems like a totally sensible pattern for what I'd like to do. One problem I've come across alre

Re: Playing with fixtures and django serializers -> Errors...

2007-04-10 Thread Russell Keith-Magee
On 4/11/07, akaihola <[EMAIL PROTECTED]> wrote: > > I wonder if it would be possible to use dumpdata and loaddata for > migration instead. Broadly speaking, it sounds viable. My only reservation would be that for large databases, dumping the entire contents to a text file isn't really a good migr

Re: Playing with fixtures and django serializers -> Errors...

2007-04-10 Thread akaihola
Unaware of the new manage.py dumpdata and loaddata commands, I've written a tool (dbpickle.py) for dumping and loading Django databases. I've used it both for moving data from one database engine to another and for migrating schema changes to production databases. I wonder if it would be possible

Re: Playing with fixtures and django serializers -> Errors...

2007-03-28 Thread Russell Keith-Magee
On 3/28/07, jj <[EMAIL PROTECTED]> wrote: > Couple of suggestions: > - django's XML parser should really allow spaces and newlines It does accept whitespace, in certain places. You should also remember that depending on the schema, whitespace can be significant in XML documents. > - it should b

Re: Playing with fixtures and django serializers -> Errors...

2007-03-28 Thread Jens Diemer
jj schrieb: > I've run into a similar problem (error: "columns app_label, model are > not unique"). > > I've found a work-around: > A easier way is to use db_dump.py ;) Look at: http://groups.google.com/group/django-users/browse_thread/thread/342efea6e3fc693d/a6807b7770b6b165 -- Mfg. Je

Re: Playing with fixtures and django serializers -> Errors...

2007-03-28 Thread jj
I've run into a similar problem (error: "columns app_label, model are not unique"). I've found a work-around: - delete the database - recreate the db from your model (using syncdb) - edit the XML (from dumpdata), removing all but your data (i.e. keep instances only, since your model is already in

Re: Playing with fixtures and django serializers -> Errors...

2007-03-16 Thread Russell Keith-Magee
On 3/16/07, Jens Diemer <[EMAIL PROTECTED]> wrote: > > Generally: I have possibly wrong data in the data base. But i think > django does not help, to find these wrong data. > I made "django-admin dumpdata" and i got this error: > """ > Unable to serialize database: ContentType matching query does

Re: Playing with fixtures and django serializers -> Errors...

2007-03-16 Thread Jens Diemer
Generally: I have possibly wrong data in the data base. But i think django does not help, to find these wrong data. I made "django-admin dumpdata" and i got this error: """ Unable to serialize database: ContentType matching query does not exist. """ I can set "--verbosity=2", but i get no more i

Re: Playing with fixtures and django serializers -> Errors...

2007-03-14 Thread Russell Keith-Magee
DB. As a warning - using MySQL will cause you some problems with the serializers. MySQL doesn't support forward references if you use the InnoDB backend, and it doesn't support row-referential integrity or transactions if you use the MyISAM backend. > The current fixture file, can

Re: Playing with fixtures and django serializers -> Errors...

2007-03-14 Thread Jens Diemer
Russell Keith-Magee schrieb: > Help me help you. In order to solve your problem, I need to know > everything you are doing - not just bits of the problem. Yes you are right, sorry ;) Here some information: I'm rewrite PyLucid CMS: http://www.pylucid.org The emphasis is thereby: Using PyLucid in

Re: Playing with fixtures and django serializers -> Errors...

2007-03-13 Thread Russell Keith-Magee
On 3/13/07, Jens Diemer <[EMAIL PROTECTED]> wrote: > > Jens Diemer schrieb: > > I can't trying this. Because now i have a error before the serializers > > starts working: """ContentType matching query does not exist.""" > > On a ot

Re: Playing with fixtures and django serializers -> Errors...

2007-03-13 Thread Jens Diemer
Jens Diemer schrieb: > I can't trying this. Because now i have a error before the serializers > starts working: """ContentType matching query does not exist.""" On a other platform it works! I don't known why... But if i import the dump i got so

Re: Playing with fixtures and django serializers -> Errors...

2007-03-13 Thread Jens Diemer
Russell Keith-Magee schrieb: > I've just finished writing a new set of tests for the serializers, > which included fixing a number of bugs. These fixes have been checked > in as of [4719]. Can you retry your tests and see if you still have > problems? I can't trying this

Re: Playing with fixtures and django serializers -> Errors...

2007-03-12 Thread Russell Keith-Magee
On 3/13/07, Jens Diemer <[EMAIL PROTECTED]> wrote: > > > I'm playing with django.core.serializers... so far with few success :( Hi Jens, I've just finished writing a new set of tests for the serializers, which included fixing a number of bugs. These fixes have been che

Playing with fixtures and django serializers -> Errors...

2007-03-12 Thread Jens Diemer
------- File ".\django\core\serializers\python.py", line 59, in Deserializer Model = _get_model(d["model"]) TypeError: string indices must be integers If i use th

Re: Problem with serializers

2006-08-04 Thread Seth Buntin
Thanks Jacob. I copied that text off of a webpage and the quotes messed me up. I guess I should have realized that when TextMate didn't color them correctly. Seth Jacob Kaplan-Moss wrote: > On Aug 4, 2006, at 12:05 PM, Seth Buntin wrote: > > DeprecationWarning: Non-ASCII character '\xe2' in f

Re: Problem with serializers

2006-08-04 Thread Jacob Kaplan-Moss
On Aug 4, 2006, at 12:05 PM, Seth Buntin wrote: > DeprecationWarning: Non-ASCII character '\xe2' in file > /Users/sethbuntin/django_projects/kate/tick/ajax_views.py on line 6, > but no encoding declared; see http://www.python.org/peps/pep-0263.html > for details > return getattr(__import__(mod_n

Re: Problem with serializers

2006-08-04 Thread Seth Buntin
I just realized that I am also getting an error in my console: /Users/sethbuntin/django_src/django/core/urlresolvers.py:118: DeprecationWarning: Non-ASCII character '\xe2' in file /Users/sethbuntin/django_projects/kate/tick/ajax_views.py on line 6, but no encoding declared; see http://www.python.

Problem with serializers

2006-08-04 Thread Seth Buntin
Here is my setup ajax_views.py: from django.core import serializers def subfocus(request): data = serializers.serialize("xml", SubFocus.objects.all()) return HttpResponse(data, mimetype="text/javascript") urls.py: (r'^tick/ajax/subfocus',