def form(requests):
if requests.method == 'POST':
name=requests.POST['name'],
# roof_age= requests.POST['roof_age'],
roof_age= int(requests.POST.get('roof_age')),
email = requests.POST['email'],
phone = requests.POST['phone'],
address = requests.POST['address'],
monthly_bill = requests.POST['monthly_bill'],
HOA = requests.POST['HOA'],
battery = requests.POST['battery'],
foundation = requests.POST['foundation'],
roof_type = requests.POST['roof_type'],
availability= requests.POST['availability'],
bill = requests.POST['bill']
details = Details(
name = name,
roof_age = roof_age,
email = email,
phone = phone,
address = address,
monthly_bill = monthly_bill,
HOA = HOA,
battery = battery,
foundation = foundation,
roof_type = roof_type,
availability= availability,
bill = bill
)
print(type(roof_age))
print(name, roof_age, email, phone, address, monthly_bill, HOA,battery, foundation, roof_type, availability, bill)
print("The data has been save to db")