Monday, December 14, 2015

Re: Multiple serializers

Hi,


I thing you have an error in you queryset.



On Mon, Dec 14, 2015 at 3:47 PM, Bruno A. <alla.brunoo@gmail.com> wrote:
Also having your models would be helpful.


On Saturday, 12 December 2015 02:21:07 UTC, Daniel Chimeno wrote:
This question is more about DRF than Django itself, I haven't use it for a while so I can't answer you,
but please, 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ó:
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:
model = Coche


        fields = ('id', 'marca', 'modelo', 'version', 'estado','anio','timestamp','valuacion')


but don't work  i need that print 


{          "id": 3,          "marca": {              "id": 1,              "nombre": "Acura"          },          "modelo": {              "id": 1,              "nombre": "ILX"          },          "version": "a5",          "estado": "1",          "anio": 2015,          "timestamp": "2015-12-08T19:12:05.887126Z"
         "Precio_Venta": 0,
        "Precio_Compra": 0
    },


the error is the next 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/811a040b-6ad0-49a8-be5d-2e2981ff4e4b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Warm Regard:-
Mandeep Kumar
     



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJri7SShng2GOy7Byy9DQqoEe94XyJ0z%3DAqa3Ciz5_XVKG-Y4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment