Fixbug HTML and Fixbug new contact
This commit is contained in:
parent
dee4e95d0d
commit
e266dce5db
2
app.py
2
app.py
@ -28,10 +28,10 @@ def new_contact():
|
||||
'''
|
||||
form = ContactForm()
|
||||
if form.validate_on_submit():
|
||||
try:
|
||||
my_contact = Contact()
|
||||
form.populate_obj(my_contact)
|
||||
db.session.add(my_contact)
|
||||
try:
|
||||
db.session.commit()
|
||||
# User info
|
||||
flash('Contact created correctly', 'success')
|
||||
|
@ -18,11 +18,5 @@ class Contact(db.Model):
|
||||
email = db.Column(db.String(200), nullable=True, unique=True)
|
||||
phone = db.Column(db.String(20), nullable=True, unique=False)
|
||||
|
||||
def __init__(self, name, surname, email, phone):
|
||||
self.name = name
|
||||
self.surname = surname
|
||||
self.email = email
|
||||
self.phone = phone
|
||||
|
||||
def __repr__(self):
|
||||
return '<Contacts %r>' % self.name
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
@ -18,7 +18,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="#">Contactos</a>
|
||||
<a class="navbar-brand" href="#">Contact Manager</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<form action="{{ url_for('search') }}" method="get" class="navbar-form navbar-left">
|
||||
|
Loading…
Reference in New Issue
Block a user