def add_contact():
    if request.form:
        with client.context():
            contact = Contact(name = request.form.get("name"),
                          phone = request.form.get("phone"),
                          email = request.form.get("email")) 
            contact.put()   
    return render_template("add_contact.html")
def add_contact():
    if request.form:
        contact = Contact(name=request.form.get('name'),
                          phone=request.form.get('phone'),
                          email=request.form.get('email'))
        contact.put()

    return render_template('add_contact.html')
Exemple #3
0
def add_contact():
    if request.form:
        contact = Contact(name=request.form.get('name'),
                          phone=request.form.get('phone'),
                          email=request.form.get('email'))
        print(request.form.get('name'))
        print(request.form.get('phone'))
        print(request.form.get('email'))
        contact.put()
        flash('!El contacto se añadio con éxito.')
    return render_template('add_contact.html')
Exemple #4
0
def add_user():
    if request.form:
        name = request.form.get('name')
        lastname = request.form.get('lastname')
        phone = request.form.get('phone_number')
        email = request.form.get('email')
        password = request.form.get('password')
        user = request.form.get('Tipo')
        objeto = Contact()
        if user == "generador":
            objeto.GuardarGenerador(name, lastname, phone, email, password)
        else:
            objeto.GuardarRecolector(name, lastname, phone, email, password)

    return render_template('add_user.html')
Exemple #5
0
 def saveUser(self):
     if self.generator.isChecked():
         objeto = Contact()
         objeto.GuardarGenerador(self.name.text(), self.last_name.text(),
                                 self.phone_number.text(),
                                 self.email_address.text(),
                                 self.password.text())
         self.name.setText("")
         self.last_name.setText("")
         self.phone_number.setText("")
         self.email_address.setText("")
         self.password.setText("")
     elif self.collector.isChecked():
         objeto = Contact()
         objeto.GuardarRecolector(self.name.text(), self.last_name.text(),
                                  self.phone_number.text(),
                                  self.email_address.text(),
                                  self.password.text())
         self.name.setText("")
         self.last_name.setText("")
         self.phone_number.setText("")
         self.email_address.setText("")
         self.password.setText("")
Exemple #6
0
def delete_contact():
    contact = Contact.get_by_id(int(request.form.get('uid')))
    contact.key.delete()
    return redirect('/contacts/{}'.format(contact.key.id()))
Exemple #7
0
def contact_details(uid):
    contact = Contact.get_by_id(int(uid))
    if not contact:
        return redirect('/', code=301)
    return render_template('contact.html', contact=contact)
Exemple #8
0
def contact_book():
    contacts = Contact.query().fetch()

    return render_template('contact_book.html', contacts=contacts)
def contact_book():
    query = Contact.query()
    names = [c.name for c in query]
    return render_template("contact_book.html",name=names[0])
Exemple #10
0
def delete_contact():
    contact = Contact.get_by_id(int(request.form.get('uid')))
Exemple #11
0
def contact_details(uid):
    contact = Contact.get_by_id(int(uid))

    if not contact: