Questions tagged as 'django-models'

0
answers

Enable search engine, import and export Excel buttons in Admin Django

I have the following code in the admin.py #Aparated 1 implements a search engine in the admin #Apart 2 and 3 Implement export and import options The search engine is correctly displayed in the admin of django, but when I add sections 2 and 3,...
asked by 02.02.2018 / 18:15
1
answer

Correct use "related_name" in Django

I surely have not formulated the question correctly, I explain what the problem is. I have in the model: models.py class Muro(models.Model): tema = models.ForeignKey(Tematica, on_delete=models.CASCADE, verbose_na...
asked by 22.01.2018 / 21:42
2
answers

Extend the Django model

The problem I have not to extend Django's model is that I need to create more than one type of user in particular two Student and Teacher each with attributes in common but with others own of each one, someone could give me some idea or example....
asked by 23.01.2018 / 01:02
0
answers

error (1054, "Unknown column 'useriorol.id' in 'field list'") django 1.10

Good afternoon, as you can see I present the following problem: error (1054, "Unknown column 'useriorol.id' in 'field list'") django 1.10 at the time of entering the administrator I select the useriorol option and I see this error. the admin....
asked by 18.12.2017 / 22:59
1
answer

Get file path from the request.POST in Django

I want to obtain the path of a file that I upload using a form but when printing the field returns a type None . My models.py is this class Insumo(models.Model): nombre = models.CharField(max_length=50) file = models.FileField...
asked by 13.12.2017 / 15:42
1
answer

Django: How to add fields to a model from another module

I have worked with an ERP (Open Object) in which modules that affect module models are added, which allow us to add functions and fields. In django something similar is possible through Meta.proxy but this limits the possibility of creating new...
asked by 30.11.2017 / 23:30
2
answers

pk of an object in a CreateView with views based on Django classes

Cordial greeting. I am in a table with users and when clicking I need to take the pk of the selected user to a form where a book will be created, so that this book is related to the user. How can I do this process or how does it work? m...
asked by 26.01.2018 / 23:42
1
answer

Django manytomany models views and templates

I have the Gammer model that is the User extension and the Competition model. many players can play a competition and a competition can have many players ( ManyToMany ) class Gammer(User): competition = models.ManyToManyField(Compet...
asked by 23.10.2017 / 23:14
1
answer

How to create an element that contains one or more elements from different Tables in my Django database

I have the following Tables: Ticket , Manager and Services Ticket has information such as creation date, manager, services and more. manager that has 2 fields name and percentage. and the services table that has 2 services and pric...
asked by 15.10.2017 / 23:52
1
answer

How to relate a model in Django with it?

I need to relate a model in Django with it, without the field of the relationship being mandatory to fill it out. Thanks in advance. Example: class Cliente(models.Model): codigo = models.CharField(verbose_name="Codigo") nombre = mod...
asked by 03.10.2017 / 22:33