Questions tagged as 'django'

2
answers

Query two or more tables

I need to obtain the price of the type to which the vehicles belong in order to add them and register them in the Rental Model class Tipo(models.Model): descripcion = models.CharField(max_length=100) precio = models.DecimalField(max_digi...
asked by 20.10.2017 / 00:32
1
answer

Work JSON data with Django

When the convertir() method is executed, all data in the table is converted to JSON , but I need to get the data for each row instead of the entire table. How can I do that? Javascript Code: function convertir() { var table =...
asked by 13.05.2017 / 13:42
1
answer

PDF with ReportLab How to make text within a table do not get out

Hello, I need to know how to make the PDF document that I generate on my site, the text that goes inside a column does not come out and if the column is not wide enough that it continues below. Look at the table SERVICE AGREEMENTS This photo is...
asked by 12.05.2017 / 14:20
1
answer

Error saving form

url.py url(r'^paciente/(?P<pk>\d+)/', PatientDetails.as_view(), name='patient_details'), view.py def add_deworming(request, pk): if request.method == 'POST': form = DewormingForm(request.POST, patient=Patient.objects.get(pk...
asked by 05.05.2017 / 21:09
1
answer

Show date filter data in Django

What I want is to make a data filter and show values according to dates. To make evaluations, monthly, quarterly and so on. To explain myself better, I leave my view.py and my form.py form.py class FiltroFechas(forms.ModelForm):...
asked by 10.04.2017 / 20:03
1
answer

Place Materialize CSS to FileField - Django

I am trying to use the File_CSS from Materialize but I can not find a way to make it work for me. This is my model: class ComprobanteDomicilio(models.Model): alumno = models.ForeignKey(Alumno, on_delete=models.CASCADE) url_documen...
asked by 30.04.2017 / 07:52
1
answer

Heroku - heroku run python manage.py migrate error

I'm trying to migrate through heroku to log in with fb but when I run the command heroku run python manage.py migrate the following happens (I'm supposed to have already done diployed in heroku): >>> heroku run python manage.py...
asked by 01.05.2017 / 02:15
1
answer

How to stop loading by default the records of a form with a foreign key type field in django?

I have a SALES form with a field of type foreign key of CUSTOMER, and I have converted it into a search engine that field on the client side, but django by default it loads all the existing records of the clients in a SELECT , and if ther...
asked by 30.04.2017 / 17:05
1
answer

Problems in data rendering django with annotate [closed]

In the view.py I have a query like this ing =ingresos.objects.filter(pk=id_jovenclub).values('natural').annotate(sum=Sum('natural')) in the template is like this {{ ing}} and it returns these values [{'sum': 1066.0, 'natural': 1066...
asked by 02.05.2017 / 18:23
1
answer

Pass value of Dateinput to variable in Django

... I'm a bit of a rookie in this django, I know how to do this kind of javascript queries, yii, jquery but in django it's a bit complicated for me. Creating a search by range of dates, because I want to keep track of income for weeks, mont...
asked by 06.04.2017 / 16:52