Questions tagged as 'django-models'

1
answer

import multiple models in another Django 2.X model

I am trying to create a form for my project with Django 2.0, with Python 3.6.4 in Windows 10, but when using a reference of some models of another app it tells me that it does not exist or that it is not defined, in a similar question said that...
asked by 23.04.2018 / 21:15
1
answer

I can not get data from the database in Django

I have an error that has been happening to me for two days, which I do not understand what it may be, is when I try to obtain the information from the database with the employee model, the code is as follows: from django.shortcuts import rende...
asked by 11.04.2018 / 21:25
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
1
answer

Send query parameters by e-mail Django

How can I send parameters of a query to the body of a message, and send it by email. The e-mail is already sent, but I need to send parameters. autorizar=AutorizacionDocumentos.objects.get(id=idDoc.id) asunto = 'autorizaciòn'...
asked by 04.04.2018 / 21:01
0
answers

Limit the entries in the models.ForeignKey ()

Is it possible to limit the entries in models.ForeignKey () to an exact amount? I have a model called a Card that belongs to a Profile, I want each profile to have a maximum of 2 cards. class Tarjeta(models.Model): perfil = models.OneTo...
asked by 22.03.2018 / 17:47
1
answer

Add total column with django-filter and paged (Django)

It is possible to add the columns of totals from django so that for example, it brings me the total of all the sales but ignores the pagination when adding the values. This is my model: class Venta(models.Model): cliente = models.Char...
asked by 19.03.2018 / 21:10
0
answers

DPI-1047: 64-bit Oracle Client library can not be loaded - Django & Windows Server 2012 R2

I am running a Django application in Windows Server R2 which makes connections to an Oracle Database, however when the queries are made from the page it shows me the following Error: DatabaseError Exception Value: DPI-1047: 64-bit Oracle...
asked by 29.03.2018 / 00:22
1
answer

is it possible to make a pivot table with the Django models?

Is it possible to create pivot tables in the database with the Django models ?, I need to create a table of that type to relate emails and telephones of a database in the tables of employees and clients Is it possible to create these table...
asked by 02.03.2018 / 20:10
0
answers

Access documents in the middle directory

I have a form that uploads several documents, but at the time of wanting to use them, I can not access them or the admin, I get an error 404, but the document is loaded to media_cdn. The project was made with django 1.10 Path of media_cdn    ...
asked by 02.03.2018 / 06:33
2
answers

How to delete Images or Videos saved in MEDIA_URL using Django

In the database the data is saved with the address that is in MEDIA_URL and they are deleted perfectly since the only thing that saves is the address, but the problem is that the files that were previously saved in MEDIA_URL, are not delete are...
asked by 23.02.2018 / 02:37