Questions tagged as 'django-1.8'

1
answer

How to sort a Django query ignoring accents?

I am returning the query Carro.objects.all().order_by(Lower('marca')) , but the order is not respecting names that start with an accent, causing these results to appear at the end of the sort order. Is there a function that can ignore acce...
asked by 04.05.2015 / 21:29
1
answer

How do I change the width of the columns in the Admin listing in Django?

How do I specify the width for the columns that are displayed in the Admin listing, more precisely the ones I specify in list_display in admin.py. Searching a similar question here , where I came to the conclusion that I should extend the file...
asked by 19.01.2016 / 15:54
1
answer

How to build a queryset that only returns the cars with the last approved revision?

I want to create a queryset that returns only the cars that had the last approved revision. It is known that there may be n cars, and each car has a history of revisions, so there may be no revisions for each car. class Carro(models.Model):...
asked by 26.02.2015 / 03:44
0
answers

Django 2.0.9 - Upload file and send by email

I'm new to Django and I'm creating a web environment that sends emails. I can send the email without the attachment, however I need to include attachment. I'm using the form with the FILE FIELD field, but when I send the email the following erro...
asked by 28.10.2018 / 15:27
1
answer

How do I create 2 forms simultaneously Django

What I want is in a single templante bring these 2 forms simultaneously, in separate pages works, but the two together still could not do. Do I need to do an intermediate form? Am I doing wrong at some point? ... forms.py from django import...
asked by 19.12.2016 / 12:28
1
answer

Import model class attributes from another app

Good afternoon guys, I'm good, a doubt! I'm using 2 Apps in django admin App1 = Registration App2 = Controllers control I imported the app1 model, the "Person" class into the "Scholarship" class, but it only takes the "Name" attribute a...
asked by 27.01.2017 / 05:57
0
answers

Exporting data to a .cfg file

Can anyone give me an example of how to export the data from my models by pk to a .cfg file? I tried to use Mymodel.objects.get(pk=pk) but it did not work very well.     
asked by 18.03.2016 / 00:18
1
answer

Problems with Custom Template Tags in Django 1.8.5

Good evening! First, I would like you to help me improve this topic, if necessary. Well, I work with Django 1.8.5, Python 3.4, virtualenv and other dependencies as well. My problem is. I have two custom template tags, one works, one doe...
asked by 11.02.2016 / 00:55
1
answer

How to work with UpdateView and Forms in the template

I'm trying to render a client's data in the template, but I'd like to do it without using {{ form.as_p }} or {{ form.as_table }} whatever, I'd like to know if there's any way to use the id of the clients in question and use inputs...
asked by 26.01.2016 / 14:46
1
answer

Autocomplete with jQuery and Django

Hello, I did a search on the site, but I did not find it, if anyone knows a link that already deals with this subject, please post. Next, I did an autocomplete in a Django form with jQuery and jQueryUI, in that form I have a foreignkey and I...
asked by 24.08.2015 / 16:18