Questions tagged as 'django'

0
answers

Break ReportLab

I have a small problem. I recently started using the ReportLab Library in Django. At first I used data with only one line and today I had to create a text file that had more than one line. Then I came across a problem. The problem is that when t...
asked by 15.02.2018 / 00:27
1
answer

Django's background color conditional fill admin

I'm wanting to coloris an entire row of a table, if its column in that row has some text, there are three possible situations: 1. the text itself, 2. fields with a "-", 3. fields with nothing. The reference column is a 9, field observation, and...
asked by 21.02.2018 / 14:50
1
answer

Django create page using Ajax

I want to upload without refreshing paging using ajax I have a table where it shows 5 items per page the goal is to change the page do not refresh the page to change to the next In views: Inthepaginationnavtemplate     
asked by 09.02.2018 / 16:45
0
answers

How to receive the username of the logged in user when sending a message through REST?

The intention of this project is to make a Chat Room. I have 2 tables, Django's predefined User table and Message table, where messages sent by users are stored. I want a user to send a message, via a form sent to the table by the sendMessage...
asked by 19.02.2018 / 03:06
0
answers

Create input mask for use in django forms

Good evening. I need to figure out how to apply masks in django's forms to a project, however, none of the previous attempts as successful. On the last test: from input_mask.widgets import InputMask However, perhaps for inexperience on my part,...
asked by 06.02.2018 / 02:46
1
answer

How to create tuple with key receiving value?

I would like to create a method that returns the Django ORM FILTER parameters. I will have to use these filters at different times, I would like to create this generic method. Here's the example: def home(selected_page=None): _config = Con...
asked by 05.02.2018 / 18:22
1
answer

How to filter an APIView to show user-related messages?

I want to create a view using APIView, which shows all the messages sent by a user specified in the url. models.py: class Message(models.Model): body = models.CharField(max_length=500) normaluser = models.ForeignKey(User, on_delete=models.C...
asked by 29.01.2018 / 20:18
0
answers

sorl-thumbnail forcing height

I have a problem with the sorl-thumbnail . When I try to force HEIGHT AND WIDTH it does not respect, it creates a value proportional to the image. get_thumbnail(avatar.url, '200x200x', quality=100) It is generating 200x133 . How c...
asked by 05.02.2018 / 22:05
1
answer

Add footer with xhtml2pdf in specific pages with Django

I have a default footer that is displayed on some pages when generating the PDF with xhtml2pdf using Django which should be positioned at the bottom of the page. But in some I do not want to display. With the current code I can position it at...
asked by 18.01.2018 / 23:04
1
answer

Settings environment timezones django postgres linux

Good morning, everyone. I have a site (Django) on a linux hosting service with Postgre SQL bank that is in New Jersey (USA). Users are in Brazil, so I have a timezone difference. I'm pretty sure this is a silly thing, with an adjustment I...
asked by 16.01.2018 / 14:09