Questions tagged as 'django'

1
answer

Get related fields Django

Good day how can I bring the related fields from another table in django, for example I have two models Person and Location since when doing the queryset it only brings me the keys, but it does not bring all the fields of the related table. m...
asked by 11.11.2017 / 14:46
2
answers

How can I simplify these conditions, is there any way?

Is there any way to simplify these conditions to a shorter one? saldo_mes_corriente= CreditoBd.objects.filter(fecha_reporte=fecha_cierre).aggregate(Sum('saldo_credito')) saldo_mes_anterior= CreditoBd.objects.filter(fecha_reporte=fecha_...
asked by 28.10.2017 / 21:34
1
answer

Bakcup Django Database

Good afternoon, I have an application in Django 1.10 in which today I need to create a backup of the bd, this copy must be made when the user clicks on a button that will be placed in a template and download the copy on the user's computer. I...
asked by 18.10.2017 / 18:40
1
answer

Error with url when listing products from index.html file

I am trying to list products in a index.html file, I would greatly appreciate your help. I have this file from the app url: from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.hello_world, name='hello...
asked by 02.09.2017 / 04:27
1
answer

Create excel from a list that has a dictionary inside

I would like to know how to create an Excel file with the data inside a list that has dictionaries nested in Python. The structure of the data is as follows: xs=[{'x': 2, 'y': 1, 'z': 4}, {'x': 3, 'y': 15, 'z': 41}, {'x': 22, 'y': 10, 'z':...
asked by 25.08.2017 / 02:29
1
answer

Django Sb Admin 2 Pandas

I'm doing a statistical portal, with Django and for the calculations I want to use Pandas, I'm trying to show some tables in the following way: Views.py def tabla(request): engine = create_engine('postgresql://postgres:xxxx@localhost:54...
asked by 26.09.2017 / 15:23
1
answer

Access the Django database from a non-Django script

When I try to access the database that Django automatically creates from the interpreter, or from a script that Django has not created on its own, I receive an error. Code where I try to import the User model of the application called ap...
asked by 25.08.2017 / 18:24
1
answer

Filter for form in Django 1.9

I have a project where I create people and products, and at a certain moment I have a screen where I should look for the products that a person has in this way: By clicking "move" I send the id of that row (it belongs to an Assigned Res...
asked by 27.08.2017 / 23:37
1
answer

Filter in Template Django

Good morning I have my application in Django 1.10 and Phyton 3, in which I will handle cards with an expiration date for each of the students. These cards have an expiration date [1], once the expiration date is over, they will go into inactive...
asked by 12.08.2017 / 17:58
2
answers

Overwrite Django's logout method

I have activated in settings SESSION_EXPIRE_AT_BROWSER_CLOSE so that when the browser is closed the session is closed. I have a function so that when the session closes I do some tasks in a table of the database, it works correctly....
asked by 12.09.2017 / 20:09