Hello I was trying to make a project and the phone number and password from the signup page is not storing but other things like name email are being registered.I tried checking it so many times but could not figure it out `
customer model
from django.db import models
from django.core.validators import MinLengthValidator
class Customer(models.Model):
first_name = models.CharField(max_length=50, null=True)
last_name = models.CharField(max_length=50, null=True)
phone = models.CharField(max_length=15, null=True)
email = models.EmailField(default="",null=True)
password = models.CharField(max_length=500,null=True)
def register(self):
self.save()
@staticmethod
def get_customer_by_email(email):
try:
return Customer.objects.get(email=email)
except:
return False
def isExists(self):
if Customer.objects.filter(email = self.email):
return True
return False
views
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models.product import Product
from .models.category import Category
from .models.customer import Customer
def signup(request):
if request.method == 'GET':
return render(request, 'core/signup.html')
else:
postData = request.POST
first_name = postData.get('firstname')
last_name = postData.get('lastname')
phone = postData.get('phone')
email= postData.get('email')
password =postData.get('password' )
customer= Customer(first_name= first_name,
last_name= last_name,
phone=phone,
email=email,
password= password)
customer.register()
return redirect('core:homepage')