Questions tagged as 'django'

2
answers

save image in django python

Hi, I would like to know if I can and how to possibly save an image in a folder whose name is entered in the title of the same model, for example: title ="animation" image = this will be stored in uploads / animation / class Imagen(...
asked by 13.06.2018 / 17:01
1
answer

How can this sql query be transformed in postgresql to query in django

Good morning to all: I have the following query in postgresql that returns the Id of the last contract that a worker has signed with a company in 2016 (from 01/01/2016 to 12/31/2016), as well as their paternal surnames and maternal, name, sta...
asked by 25.03.2017 / 14:16
2
answers

Problems with query in django

In the database I have these values INSERT INTO 'principal_ingresos' ('id', 'instalacion_id', 'natural', 'juridico', 'fecha') VALUES (1, 1, 1066, 0, '2017-01-04'), (2, 1, 754, 0, '2017-02-08'), (3, 1, 1253, 0, '2017-03-09'), (4, 2, 2504, 0, '2...
asked by 03.05.2017 / 15:48
2
answers

Heritage in Django models

In Django models, when you create a class that inherits from another that is not abstract, for database purposes, it's like creating a one-to-one relationship between the two tables. Starting from the following      example: class...
asked by 15.09.2016 / 13:42
2
answers

Images and texts are displayed at different heights

You see, something fails to use table tags, because the texts are put at different heights, which affects even images. HTML code: <table> <tr> {% for alfa in categoria %} <td> <img src="{% static alfa.foto %}"/> <...
asked by 13.05.2017 / 11:37
1
answer

How to relate an 'Object' to several 'Objects' Foreigkey

Asking for your support again, I am making an application to inventory the electrical and optical ports of various equipment, and it is not clear to me how to relate a model with several models. I have the following two objects: class ITarj...
asked by 20.08.2016 / 11:59
1
answer

Filtering API Rest Framework Django (Extra Field FK)

I would like to be able to filter by the value of another field in the table (FK) not only by id Right now if I write link it returns the results I want , but I would like to be able to filter in the following way (for another field of...
asked by 23.05.2016 / 13:18
1
answer

MultiUpload Django Admin

I have a django project in which from the admin I can upload photos one at a time, now, I want to upload more than one for the same element (database registration) and I would like to know what is the way less traumatic and easy, since it is usu...
asked by 26.09.2016 / 12:51
1
answer

SQLite when deploying a project done in Django

I have my project done with Django and I will upload it to a server that has support for Django (obvious), but the database that I used during the development was SQLite. The Web server only supports MySQL but my question is: When SQLite i...
asked by 11.02.2016 / 20:38
2
answers

Doubt about the way to show a form

Good evening, I have a form created in the following way: (in forms) RESULTADO_P = ( ('a', 'a'), ('b', 'b'), ('c', 'c'), ('?', '?'), ) class formulario(forms.Form): r1 = forms.ChoiceField(choices=RESULTADO_P, initia...
asked by 07.02.2016 / 15:17