Greetings!!
I have a submit/display function that is not displaying all the values after fields have been sent through. Any help would be greatly appreciated.
my submit form:
{% extends "CMS/base.html" %}
{% block content %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<form method ='POST'>
{% csrf_token %} <!-- prevent faking the form-->
{{ form.as_p }} <!-- #display the form-->
<input type ="submit" value="submit user"/>
</form>
</body>
</html>
{% endblock content %}
my model:
class Casa(models.Model):
Student = models.CharField(max_length=25,blank=False)
Cohort = models.CharField(max_length=44,blank=False)
Phone_Number = models.CharField(max_length=15,blank=False)
Email_Address = models.CharField(max_length=44,blank=False)
Home_Address = models.CharField(max_length=44,blank=False)
City = models.CharField(max_length=25,blank=False)
State = models.CharField(max_length=3,blank=False)
Zip_Code = models.CharField(max_length=10,blank=False)
def __str__(self):
return self.title
def get_absolute_url(self):
return reverse('entry',kwargs={'pk': self.pk})
potentially important base page
{% extends "CMS/base.html" %}
{% block content %}
<section>
<section class="row">
<div class="col-md-4">
<strong>First/Last Name</strong>
</div>
<div class="col-md-10">
{{ casa.student }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>Cohort</strong>
</div>
<div class="col-md-10">
{{ casa.cohort }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>Phone Number</strong>
</div>
<div class="col-md-10">
{{ casa.phone_number }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>Home Address</strong>
</div>
<div class="col-md-10">
{{ casa.home_address }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>Email Address</strong>
</div>
<div class="col-md-10">
{{ casa.email_address }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>State</strong>
</div>
<div class="col-md-10">
{{ casa.state }}
</div>
</strong>
</section>
<section class="row">
<div class="col-md-4">
<strong>Zip_Code</strong>
</div>
<div class="col-md-10">
{{ casa.zip_code }}
</div>
</strong>
</section>
</section>
{% endblock content%}
kind regards,
BMT