Questions tagged as 'django-models'

1
answer

Django upload only the data of a file

I'm working on the managed interface of Django, I've tried in different ways to popular tables with files xls , csv or txt without success, I know how to upload a file but not just use the data, or failing that upload the fil...
asked by 25.08.2017 / 19:55
0
answers

Django queryset without models

I need to make queries to the database ( postgresql ) but the tables I want to consult were created by pandas so I do not have a model to refer to, how do I do queries without models?     
asked by 14.09.2017 / 20:22
0
answers

Url with period "." in Django Rest Framework

I have the following model with primary_key=True specified classTeam(models.Model): name = models.CharField( max_length=64, primary_key=True, ) ... other fields My serializer is the following: classTeamS...
asked by 11.01.2017 / 06:23
1
answer

Add new fields on models.py in Django

I have the following model in models.py: class Videos(models.Model): title = models.CharField(max_length=45) link = models.CharField(unique=True, max_length=45) class Meta: managed = True db_table = 'Videos' d...
asked by 02.01.2017 / 20:07
1
answer

Django, query summation of one table to another connected to the foreigner

I have the following models: class Articulo(models.Model): nombre = models.CharField(max_length=80) costo = models.DecimalField(max_digits=6, decimal_places= 2) precio = models.DecimalField(max_digits=6, decimal_places= 2) famil...
asked by 25.10.2016 / 18:21
1
answer

Is it possible to display an image from a TextField () field? [duplicate]

Can I show images by inserting the link in a TextField () field ?? The link to the image does work but when I insert it in the body of the post (variable text = models.TextField () ) it appears as text only. Can not this be done with TextF...
asked by 03.08.2016 / 17:25
3
answers

Problem csrf_token generated models admin

As I can put {% csrf_token %} to the forms that I generate in the Django admin, I have this problem about these forms and I do not know how to edit them because I have consulted and the solution is to put {% csrf_token %} in the fo...
asked by 15.12.2015 / 20:27
1
answer

Error creating the model class

I have been with this error for many days and I do not know what it is. Can someone help me? I already try several things and do the migration again but it does not let me     
asked by 25.07.2018 / 02:52
1
answer

Doubt at ManyToManyFields Django

I'm new to Django and I'm just learning several things, let's say I have the following model where I have the Person, Car and Loan classes, a person in a loan can select several cars class Persona(models.Model): nombre = models.CharField(m...
asked by 05.01.2018 / 04:09
1
answer

Complex query in Django ORM

I have the following table with the following records: |id | datetime | state_id | brand_id | customer_id | recommender_id | |---|----------|----------|----------|-------------|----------------| | 1 | ... | 5 | 1 | 32...
asked by 05.04.2018 / 16:42