Questions tagged as 'django'

0
answers

Convert HTML to PDF and insert Image with Django

The image does not appear in PDF, I use xhtml2pdf. reports / sol_acesso.html <img src="{% static 'img/small_logo.png' %}" alt="Blue Tech" style="max-width:200px; margin-top:10px"> view.py ' def get(self, request, pk, model):...
asked by 11.01.2018 / 17:43
0
answers

Questions about Django MTV

I'm having a hard time understanding the Django concept. Please check if my design is correct: MTV refers to the Model Template View. Model would be my database. Template would be the interface displayed to the user (HTML, for example...
asked by 21.12.2017 / 19:17
1
answer

Error in Django Art matching query does not exist.

Good evening, everyone. This is my first post in the forum and I am also a bit lazy in django. I'm developing a project that involves a model called Art and in one of the views I need to do the data update. I made the whole part of the form and...
asked by 17.12.2017 / 06:26
1
answer

How do I register multiple records

I want to make several contact records, I wanted them to be more dynamic, for example, the person has a number of phones or cell phones or email's and while on the site, he can click on a sum sign and the page presents new boxes to enter this da...
asked by 31.12.2017 / 03:42
2
answers

Display items from a list in django html

My code is as follows: {% for item in saldo %} {{item}} {% endfor %} And I would like to present the numbers (in the image), each in each line. Does anyone know how? I tried to make a "for" inside the post but it does not work.     
asked by 02.01.2018 / 15:35
1
answer

Create condition with date in UNIX format Timestamp - Django

I have a table in the database that the date fields are of type BigInteger, in which it receives a date in the format Timestamp. How do I make a SELECT in the table with the following conditions: SELECT COUNT(log.id) AS QTD FROM...
asked by 05.01.2018 / 18:25
0
answers

View data from csv files in view

I want to display data from a file in the django template. I do not know how. If in model or view. Ucsal application. Model: from django.db import models import pandas as pd class Arquivo(models.Model): def __dados__(self): re...
asked by 03.12.2017 / 01:27
0
answers

AttributeError: 'AsgiRequest' object has no attribute 'user_agent'

Replace my WSGI to ASGI to run Django Channels , as it says in documentation . The problem is that user_agent has stopped working, where I detect whether it is mobile or not. I had created a function in context_processo...
asked by 28.11.2017 / 17:43
1
answer

get the logged in user and save the id using inline formset

Hi, I'm having a problem getting the logged-in user ID simplifying, I have a form where the user will enter the information and when he gives the submit the user will also be saved together, because I will need the user because the system will d...
asked by 22.11.2017 / 13:01
0
answers

Doubt in SQL conversion to Django ORM

Hello I am studying starting in Django ORM and would like help to convert the SQL below as I am not able to perform the necessary joins. Following: SELECT P.nome, T.nome FROM professor as D INNER JOIN pessoa_fisica AS PF ON (D.pessoa_fisi...
asked by 16.11.2017 / 15:08