Questions tagged as 'django-forms'

1
answer

Create models.forms dynamically in Django

Good Night with everyone There is some way to create Django form from the existing Django models in a dynamic, automatic way or maybe by doing a for or a loop. I ask this question already if I have for example 2 Company and Book models, th...
asked by 21.02.2018 / 04:58
1
answer

Modifying some Django admin behaviors regarding their generated forms

I have a model which I am manipulating through the Django administrator. The model and "its business logic" requires me to establish a specific behavior regarding its form to enter data. What I need to do is the following: I have the follo...
asked by 01.02.2016 / 22:24
1
answer

Display radio button in django?

Hi, I have this problem ... I can not manage to display the radio button in the template ... in which I'm wrong? models.py class Genero(models.Model): MASCULINO ='mas' FEMENINO ='fem' Type_CHOICES = ( (MASCULINO,'masculi...
asked by 05.02.2017 / 02:14
2
answers

How can I create a field in a form without having to create it in a model?

I have a ModelForm in which I want to add a field without having to create it in the model, how can I do it? If you are wondering why I want to have a field in a form if I am not going to send it to the model, it is because I am going to take...
asked by 25.08.2017 / 02:57
1
answer

NOT NULL constraint failed: django

I'm getting an error when I try to create a new element by a form, trying that the user who is already with the session started can upload an image and it is recognized as his in the relationship with the base of data that I have in models.py...
asked by 29.08.2017 / 06:18
1
answer

Django - Modify widget Select custom list?

Very good, I would like to know how to modify my select with a modified query, I make myself explain ... models.py class Equipo(models.Model): nombre = models.CharField(max_length=200) color = RGBColorField() torneo = models.For...
asked by 06.04.2017 / 20:58
1
answer

MultiUpload Django Admin

I have a django project in which from the admin I can upload photos one at a time, now, I want to upload more than one for the same element (database registration) and I would like to know what is the way less traumatic and easy, since it is usu...
asked by 26.09.2016 / 12:51
1
answer

Storing ManyToMany fields in a forms.ModelForm form

I am building a form based on some models in one of which I have attributes with ManyToMany relationships to others. The situation is as follows: Model CorporalSegment class CorporalSegment(models.Model): SEGMENTO_HOMBRO = 'Hombr...
asked by 19.07.2016 / 04:47
1
answer

Selects nested with Django and AJAX

I am doing tests for a form that I must do and the most important thing are two combo boxes, where the second one depends on the choice of the first one. I have done many tests with different methods but I have not achieved the result I need....
asked by 26.09.2017 / 18:29
2
answers

Validations in Class Based View ... form_valid or form_invalid

There is something I do not understand when making validations in class-based views ( CreateView , UpdateView , etc), I understand that you can do with the method form_valid and then save it with a simple form.save()...
asked by 05.09.2017 / 14:35