Questions tagged as 'django-models'

1
answer

How to add a value from one table to another table with django

The point is to make an accounting entry. I'm using the admin of django and when I create a seat I must use two accounts (which already exist in the table account) and those add or subtract the value that entered the seat (total), the thing is t...
asked by 27.02.2017 / 06:21
2
answers

Download a PDF in Django

Hi, any suggestions to download a pdf file I have the following model where I keep the files: class Archivo(models.Model): archivo_pdf = models.BinaryField(null=True, blank=True) nombre = UCharField(max_length=30, null=True, blank=True...
asked by 21.10.2016 / 00:17
2
answers

can not import name commit_on_success, Mockups in django 1.9

I installed Mockups in django 1.9, initially I sent the error: ImportError for import_module and I solved it with: link now I get another import error: File "/home/alejandro/django190/local/lib/python2.7/site-packages/mockups/management/comm...
asked by 31.08.2016 / 04:57
1
answer

help with Django Models

I am new in the programming field and I am learning django and python at the same time. I want to create a database with three tables. project, parts and processes. A project can have several pieces, but a piece can not belong to several project...
asked by 19.12.2016 / 23:11
1
answer

Create a model with a ForeignKey and another field

I wish you a good start to the week and I take this opportunity to ask a question about the implementation of my model in django 1.9 using mysql: I have a catalog of authors and each one has a unique id, each author participates in one or sev...
asked by 25.07.2016 / 21:59
1
answer

How to include an annotate field in filter Django?

I'm trying to make a filter with the field total_clasificacion , but It gives me the following error.    NameError: name total_classification is not defined listado_facturas = Clasificacion.objects.filter( Q(factura__cliente=1)&a...
asked by 14.09.2016 / 17:44
1
answer

Handling fields (multiple selections) with values that depend on a value in a previous field - Django

I want to make a form where the values of a particular field depend on a selected value in a previous field. The idea is that both fields must be of multiple selection. I was working with django-smart-selects , but I had these two drawbacks...
asked by 02.03.2016 / 21:11
1
answer

Perform queryset between 3 models

I have 3 models: Student, Characterization and semester I need to obtain a queryset with the semesters that NO have been registered in the characterizations of each student. I mean, each student can have a number of characterizations and...
asked by 10.10.2018 / 00:43
0
answers

Form Django ImageField edit delete checkbox

I'm in a Django form and I want to modify the automatic checkbox that comes out in an ImageField field. The problem is the following: The box to clean the saved image appears on a top line, and what I want is to appear next to the word...
asked by 14.09.2018 / 09:14
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