Questions tagged as 'django-models'

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 / 02:32
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 / 19:05
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 / 18:52
1
answer

How to look at two models at the same time

I have the following models: class Videos(models.Model): title = models.CharField(max_length=45) class TimelinePoints(models.Model): description = models.CharField(max_length=45) videos_id = models.ForeignKey('Videos', models.DO_N...
asked by 26.03.2017 / 22:55
1
answer

Something is wrong with a Django model

You see, I have created a model which is used to link a comment to a user. This is the code models.py: class mensajeria(models.Model): texto=RichTextField(max_length=300) usuario=models.OneToOneField(User) def __srt__(self):...
asked by 26.05.2017 / 13:14
2
answers

What exactly does a --fake migrations in django?

I ran the command python manage.py migrate app --fake and it worked I do not have any errors, but I have no idea why doing this worked and I do not want to keep that gap in the project ... which is what it does exactly --fake.     
asked by 14.02.2017 / 08:15
1
answer

Upload Form Django Error (invalid literal for int () with base 10)

I have a form with which I want to make an "insert" in one of the models and it gives me the following error and I am not able to know why or debug: invalid literal for int () with base 10 views.py def poiUploader(request): title...
asked by 11.10.2016 / 13:29
2
answers

Python - Django error when creating super user

I am creating a student management service. Once I finish designing the models I make the migrations (makemigrations and migrate) of my apps, without problems. But when trying to create a super user, this error occurs: Nombre de usuario: Admin...
asked by 24.12.2018 / 18:43
1
answer

convert render_pdf to get a list

I need to modify the render_pdf so that it receives the data that is stored in a list, since currently it does not show me any information. my code is this: Views.py class PDFprueba(View): def get(self,request,*args,**kwargs): datos =...
asked by 18.12.2018 / 23:32
1
answer

Print model data to a pdf

I need to show data from the database to a pdf, until now it generates the pdf but with static data that I added to it VIEWS.PY class PDFprueba(View): def get(self,request,*args,**kwargs): datos = { 'nombre' : 'jose...
asked by 17.12.2018 / 23:29