1๐
โ
ok guys i just fin the error to my problem, i going to post here for other people with the same problem.
In my serializer i dont specified the โidโ
class ProductoSerializer(serializers.HyperlinkedModelSerializer) :
class Meta:
model = Producto
fields = ['url', 'nombre', 'codigo', 'precio', 'serie_producto', 'marca']
soo, the solution is:
class ProductoSerializer(serializers.HyperlinkedModelSerializer) :
class Meta:
model = Producto
fields = ['id' #here ,'url', 'nombre', 'codigo', 'precio', 'serie_producto', 'marca']
๐คWuaFlees
0๐
django.urls.exceptions.NoReverseMatch: Reverse for 'Add' with arguments '('',)' not found. 1 pattern(s) tried: ['agregar/(?P<producto_id>[0-9]+)/\\Z']
This error tells you that the view with name 'Add'
expects an integer argument, but you passed it an empty string ''
. To debug this, you can add print(datos)
before your render()
call. Most likely you will see a list of JSON objects with at least one that has id: ""
.
๐คCode-Apprentice
- [Answered ]-How to set up django-admin.py on windows vista?
- [Answered ]-Django โ Reading Excel File
Source:stackexchange.com