Questions tagged as 'django-forms'

0
answers

Filter values of a field from a list [...] - Query Django

class Grupos(models.Model): grupo = models.CharField(max_length=300) familia =models.CharField(max_length=300) fg = models.CharField(max_length=300) status=models.IntegerField(defaul...
asked by 27.05.2018 / 05:27
1
answer

Save model with many-to-many field using CreateView

I have the following problem I have two models one Themes and another Videos have a relationship much to many already that a video can deal with different topics, the problem is that when saving a video I do not give any error and I am saved but...
asked by 16.05.2018 / 04:23
2
answers

How can I iterate the following data dictionary in Django

I have the following models in python: class ModuleType(models.Model): name = models.CharField(max_length=150, unique=True) icon = models.CharField(max_length=100, unique=True) state = models.IntegerField(choices=state_choices, def...
asked by 24.04.2018 / 23:56
1
answer

Django ModelForm filter according to another field

I am trying to make the drop-down list of a field change according to what you have selected in another field, in my case it changes the state according to the selected municipality, that is to say that only the states corresponding to that muni...
asked by 04.05.2018 / 16:58
1
answer

import multiple models in another Django 2.X model

I am trying to create a form for my project with Django 2.0, with Python 3.6.4 in Windows 10, but when using a reference of some models of another app it tells me that it does not exist or that it is not defined, in a similar question said that...
asked by 23.04.2018 / 21:15
1
answer

how to clean request.POST? Django

I am doing a card payment process. When making the confirmation of the transaction I want to be able to delete the POST data so that I can not make a new transaction when reloading the page. My code is this: def comprar(request,producto,sto...
asked by 12.04.2018 / 11:59
1
answer

Add total column with django-filter and paged (Django)

It is possible to add the columns of totals from django so that for example, it brings me the total of all the sales but ignores the pagination when adding the values. This is my model: class Venta(models.Model): cliente = models.Char...
asked by 19.03.2018 / 21:10
0
answers

Access documents in the middle directory

I have a form that uploads several documents, but at the time of wanting to use them, I can not access them or the admin, I get an error 404, but the document is loaded to media_cdn. The project was made with django 1.10 Path of media_cdn    ...
asked by 02.03.2018 / 06:33
1
answer

change value of a datetimeWidget from JQuery

I create a DateTimeField with Django in the following way: start_date_edited = forms.DateTimeField(label="Fecha inicio", widget=DateTimeWidget(usel10n=True, bootstrap_version=3), required=False) That creates a field where to enter a date, w...
asked by 11.02.2018 / 22:12
0
answers

Bug Update Django Formsets

I am trying to modify a sale in which I have this view: views.py class VentaUpdate(UpdateView): model = Venta template_name = 'venta/venta_form.html' form_class = VentaForm success_url = reverse_lazy('venta:ventas_listar') def get_context_...
asked by 05.02.2018 / 18:27