forms

Page not found (404) Error in Django when creating a checkout session with Stripe

Page not found (404) Error in Django when creating a checkout session with Stripe Question: I am working on my first Stripe integration project to Django and I have landed into a problem that I have not managed to figure out a solution. I am trying to create a session whereby users can be redirected …

Total answers: 1

Django forms: how to use optional arguments in form class

Django forms: how to use optional arguments in form class Question: I’m building a Django web-app which has page create and edit functionality. I create the page and edit the pages using 2 arguments: page title and page contents. Since the edit and create code is very similar except that the edit code doesn’t let …

Total answers: 2

Django form with multi input from loop save only last record to database

Django form with multi input from loop save only last record to database Question: I have a problem with saving data from a form in django. Only the last record is saved. I generate a list of dates (days of the month) in the view and display it in the form in templates along with …

Total answers: 3

Save FK on post in django

Save ForeignKey on post in django Question: I am having trouble with saving a fk in Infringer table on post. I am trying to save the customer ID when I add a record. For troubleshoot purposes I added a few print lines and this the out put. As you can see below the correct customer …

Total answers: 1

Why does my Django form data not appear in the database?

Why does my Django form data not appear in the database? Question: I try to develop a simple input form to save a deposit for a fishing vessel. The vessel and the net are tables in the database. There is no error when the form is submitted but there is nothing happening in the background. …

Total answers: 2

Save customer in the background on django forms

Save customer in the background on django forms Question: Hi I am trying to automatically save the customer on post without having to list it in the forms. It currently shows the drop down and saves correctly but if I remove customer from forms.py it doesn’t save anymore. views.py @login_required(login_url=’login’) def createInfringer(request): customer=request.user.customer form = …

Total answers: 2

Fill out the form and save it in db base

Fill out the form and save it in db base Question: I am working on a Django project and I want to fill out a form and save the data in the db database and then be able to show it on another page, I managed to create the form, following some tutorials, but it …

Total answers: 1

Problems on post method with form and tuple data

Problems on post method with form and tuple data Question: I’m trying to make a post request to this url: url I’m trying this code to get this request: from requests import get, post data = { ‘entrada’: { ‘site’: ‘site’, ‘origen’: ‘origen’, ‘tipo’: ‘turismo’, ‘fecha’: 2022, ‘marca’: -1, ‘marcanombre’: ”, ‘modelo’: -1, ‘modelonombre’: ”, …

Total answers: 1

Ajax Flask Retrieve Data of Multiple Forms in Server Side

Ajax Flask Retrieve Data of Multiple Forms in Server Side Question: I am sending multiple form data as an formdata object using ajax to python flask. Just like the example here. In the below code, I am sending data of two forms using ajax to flask. I can’t retrieve it on server side, However I …

Total answers: 1