Specific questions related to forms with the Django web framework

0
votes
1answer
17 views

Adding forms to Django DetailView ERROR message:Method Not Allowed (POST)

Hi Djangonauts I am trying to Build a Question and Answer type app like "StackOverflow" or "Quora" I am new to Django. so please forgive any silly mistakes in logic or code. Below is my errorBefore: ...
0
votes
1answer
17 views

Django form post request without rendering

I have django form, then for each field I set initial value. How can I make POST request in my view.py (like after pressing submit button) without rendering the form. I just need to send these initial ...
0
votes
1answer
15 views

Cannot assign “<SimpleLazyObject: <User: admin>>”: “Project.manager” must be a “Profil” instance

Hello I have this error when I start saving a form. Cannot assign "<SimpleLazyObject: <User: admin>>": "Project.manager" must be a "Profil" instance.I have two applications account and ...
0
votes
1answer
20 views

python - Django built in login view not redirecting to next

I am using django auth views for authentication but after successful login it should try to redirect the user to the next GET param but it is redirecting to LOGIN_REDIRECT_URL only!here is my url...
0
votes
1answer
20 views

Dictionary as choices in choicefield inside forms.py

Im giving the choices for a choicefield in forms.py as a dictionary. I've imported my dictionaries page as dicto. da=[dicto.country_array]country=forms.ChoiceField(choices=da,widget=forms.Select(...
0
votes
2answers
28 views

python - Django redirect to next after login (Generic Form View)

I am using generic form view for authentication, I am getting next parameter in url but unfortunately I don't know how to redirect it to next, after successful login for Generic Form View, here is my ...
-1
votes
0answers
21 views

is posible disable field validation django? [on hold]

I am using Form and field validation and would like to know how I can disable the validation of a field in django?
0
votes
0answers
9 views

An other way to manage Django Model instance from ModelChoiceField in formset

I'm not sure if it's possible. I'm trying to use Django (2.0) Form and Formseton a view. Here is my models: from uuid import uuid4class Aliment(models.Model):id=models.CharField(...
1
vote
0answers
19 views

how to display checkboxes in templates depending on loaded enties of a model

I have a model named Publication that has several fields among them a field called tags, and I'm using for it django-taggit.I have a page that I display in it some entries of Publication model, I ...
1
vote
1answer
23 views

Adding field to form only if the model field is blank

I want to have a form that populates fields to edit only if they are left blank. For example:class UserEditConcert(forms.ModelForm):class Meta:model=models.Concertfields=(...
0
votes
1answer
17 views

How to display a field from a modelchoice

I have a class in my forms and a object called tiposervico (ForeignKey). See bellow.In my template, after select a tiposervico I would like to display 'descricao' field on my screen. How can i do ...
1
vote
1answer
28 views

Why should I set max_length when using Choices in a Django model?

In the official Django 2 tutorial I found this:from django.db import modelsclass Student(models.Model):FRESHMAN='FR'SOPHOMORE='SO'JUNIOR='JR'SENIOR='SR'...
0
votes
0answers
25 views

Fetching rows from a table in django

views.py:rows=Nonelocname="select location_name from locations"cursor=con.cursor()a=cursor.execute(locname) rows=a.fetchall() return render(request,'project/...
1
vote
1answer
18 views

Remove “---------” from model choice field with radio select widget

In my forms.py I have this field below that returns 2 records, but it displays 3 records on my screen. I don't want the first one "---------".tipopagamento=forms.ModelChoiceField(widget=forms....
0
votes
0answers
5 views

How to create multiple django form fields from a JSONField

I need to have dynamic form fields in my store. Some users might add additional fields to the Product model. What I've done is to create the form fields with JS on change of a number input.Then in ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,