I have following scenario. User fills out a form If the user clicks the “continue” button and the form is valid the user will be redirected to a summary view In the summary view the user checks the input again. He can either continue or go back. If he continues the data will be saved in the database, if he
Tag: django-forms
Django forms not saving posts to database
i am trying to create a course from my frontend using django form, everything seems fine but when i hit the create button it just refreshes the page without saving to database or throwing back any error, and that is not what i am expecting. create-course.html models.py forms.py Answer this was fixed by just uploading an image, but i wasnt
Django forms.Form reflecting property field constraints
I’m implementing a Django Form witch should contain the field ‘fieldA’ from modelA: My question is: Is there a way to have Django form, which will automatically handle validation of fieldA (check the max_length)? I know I Could use form.ModelFormclass referring to ModelA, but then the form would reflect all the fields of the ModelA. I would like to use
Calculate Input Fields while user is filling data in form – Django Model Form
I have a user form through which I can save data to the database. I want certain fields to be auto calculated while I am filling the the form. For e.g. Net Weight = Gross Weight – Tier Weight and stuff like that. I also want to add RADIO BUTTONS for fields like LOADING, UNLOADING, DEDUCTION, etc. where values will
how to update record and same record create in other table in django form
i have 2 model one is Tempdriver and other one is Hiring, i am register new customer in Tempdriver table, i need when i edit tempdriver record and status is (accept) and when i save this record then need to same record create on hiring table with matching column with status=(Applied on app) rest column should be null in hiring
The view home.views.login_view didn’t return an HttpResponse object. It returned None instead
I am trying to create role based login system but it continuously showing the mentioned error N.B: I’m new to django Answer Every view in django should return an instance of HttpResponse object, therefore you need to cover all edge cases, e.g.:
I have updated my code– I want to pass an object in “for loop” with employee_id and his specific donation amount, How can I do this?
I am working on a donation app. In this app, There was a feature that sends an equal amount of donation money to every employee of the organization now they want to change this feature by sending a customized amount of donation to all or some of the employees. I have worked on it: Now I am using a for
get more than two foreign keys from another django table and perform calculations on them
In the Django app, I have created two tables. Product Invoice I have one table called Product which contains product name and product price columns are given. Then, I have a second table named Invoice which contains a product name(foreign key), product price(foreign key), discount, and total. My concern is how can I import both the values from the Product
I am trying to add a new field to the default Django Form and am getting an error when I’m trying to import a class from a forms.py file I made
The error is occurring in views.py file in which when I try to import the form class I made from my forms .py file I get an error of… Here is what my views.py file looks like: And here is my forms.py file Why am I getting that error/what am I missing? Answer You problem comes from importing “from django.contrib.auth
Field ‘id’ expected a number but got ‘Free’
i’m trying to add a form, so users can post thier own articles , but when i hit publish button it shwos Field ‘id’ expected a number but got ‘Free’. . i wasn’t adding the package_category field to the forms because i have set a default value for it in my models.py when i now add the package_category field to