Questions tagged as 'django-views'

1
answer

Join two QuerySet of different models in Django

I am trying to make a query to two different models, which have a common field. This is my file models.py : class Service(models.Model): client = models.ForeignKey(Client, on_delete=models.CASCADE) # otros atributos class Visa(m...
asked by 13.12.2018 / 18:13
0
answers

convert mysql query to django

Guys! I have this query that I want to use in Django and I can not find a way to do it. I hope you can help me: SELECT herramienta_id, SUM(cantidad) FROM inventario_transaccion WHERE carrito_id=1 GROUP BY herramienta_id What I want to do...
asked by 25.07.2018 / 01:18
1
answer

'NoneType' object has no attribute 'split'

I can not access to search for a user since I get the error of split . This is my code: views.py def buscar_usuario(request): from django.utils import simplejson busqueda = request.GET.get('busqueda') busquedas = busqueda....
asked by 16.11.2018 / 22:55
1
answer

Redirect Django with paramentros

I'm running a payment gateway in Django and I'm trying to split the procedure into two views, one makes the call and gets the answer and the second processes the response. Right now my code is something like this: def comprar(self): ......
asked by 02.04.2018 / 16:34
1
answer

convert render_pdf to get a list

I need to modify the render_pdf so that it receives the data that is stored in a list, since currently it does not show me any information. my code is this: Views.py class PDFprueba(View): def get(self,request,*args,**kwargs): datos =...
asked by 18.12.2018 / 23:32
0
answers

MultiValueDictKeyError in / systembox / buy_do

Help because of the error when I run python manage.py runserver and it does not recognize my products. views.py def comprar(request): productos = literal_eval(request.POST["productos"]) pago = literal_eval(request.POST["pago"])...
asked by 17.11.2018 / 22:02
0
answers

UpdateView problems updating a field

I am trying to make an inventory of tools, with which I can monitor the amount of tools I have, who has them (in which tool carts they are) and a record of the damaged tools. I created a view where I display a list of existing carts or a butt...
asked by 26.07.2018 / 02:36
0
answers

Django: delete a record from my table in one view and add the record in another table

I'm doing an inventory application for my workshop. I have a view that generates a tool cart, in the cart the employee assigned to the cart is assigned, the tools it contains and the quantity of each of them. What I intend to do is the following...
asked by 20.07.2018 / 23:28
0
answers

identation error: expected and indented block

I have a problem when I want to render my view, I skip this error and what I see is not a tabulation problem, I am not very expert in this django so I would appreciate your help, this is my view where I get the error from django.shortcuts impo...
asked by 14.06.2018 / 23:15
1
answer

How to filter a query_set for unique Django values

I'm trying to get unique value results from a query_set in django. What I want is for you to return me as many unique classifications There is. Example. In a Table I have different articles that are classified by type ID | NOMBRE...
asked by 14.04.2018 / 19:43