Questions tagged as 'django'

1
answer

Show Queries with ORM grouped by a field and SUM for each TYPE in DJANGO

Very good, I have records in my DATABASE in POSTGRES and from Django ORM I try to make a query: Each record has a COST and TYPE field, and there may be N record of only one type with different prices. What I want is to bring, the sum of the COST...
asked by 12.07.2017 / 23:14
0
answers

send a pk of an object to a createview as fk of the other object

models class Mascota(models.Model): nombre = models.CharField(max_length=25) raza = models.ForeignKey(Raza, null=False, blank=False, on_delete = models.CASCADE) color = models.ForeignKey(ColorMascota, null=False, blank=False, on_...
asked by 06.12.2018 / 04:54
0
answers

Error: Enter Valid Date

Someone can help me by solving this error: "Enter Valid date" when entering a date of birth. This I currently have: Settings: DATE_INPUT_FORMATS = ['%Y-%m-%d','%m-%d-%Y','%d-%m-%Y','%d-%m-%y'] Model: fecha_nacimiento = models.DateFiel...
asked by 26.11.2018 / 16:57
1
answer

django missing 1 required keyword-only argument: 'manager'

I have the following error when accessing the "Norma" model through the django administrator. " missing 1 required keyword-only argument: 'manager' " The complete error is as follows: Internal Server Error: /admin/norma/norma/ Traceback (...
asked by 12.12.2018 / 20:57
1
answer

Convert RawQuerySet to QuerySet on DJango

I have the following Code: from django.shortcuts import render from estudiante.models import Estudiante from caracterizacion.models import Tipo, Caracterizacion from .filters import EstudianteFilter # Create your views here. def principal(re...
asked by 21.11.2018 / 07:44
0
answers

Django - coercing to Unicode: need string or buffer, tuple found

I am putting together an app that handles requests to send packages and when generating a new request for a shipment I was stuck with the following. This is the request model. As you can see I am trying to bring 2 fk from models...
asked by 01.12.2018 / 15:57
0
answers

How can I pass the id of a product from a template to another template in django?

I am working on a project in django and I have the following problem I have a list of products in a table, which belong to a common list (list with id 26), as seen in the following image: Now I need that when you click on the "add produ...
asked by 01.12.2018 / 12:45
0
answers

how to change a boolean by clicking on an image with django?

I'm trying to change a Boolean value in my database by clicking on an image in Django I add my View, my Model and my html. View def reservacion(request): estatus = Asientos.objects.get(asiento=Aqui me gustaria colocar el valor del id del ht...
asked by 25.11.2018 / 01:23
0
answers

Social-auth with django

Hello everyone, I have the following error and I think I have added everything that I need to make it work. in the view I have the following: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U...
asked by 17.11.2018 / 19:46
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