Beispiel #1
0
def event(event_id):
  event = VRDB.event(event_id)
  form = VRForms.addevent(MultiDict(event))
  customers = VRDB.customers()
  attendence = VRDB.event_attendence(event_id)

  return render_template('event.html', form=form, customers=customers)
Beispiel #2
0
def add_event():
  form = VRForms.addevent()
  if form.validate_on_submit():
    event_id = VRDB.event_add(name=request.form['name'], date=request.form['date'],
        description=request.form['description'])
    app.logger.debug('moo') # XXX
    return redirect(url_for('event', event_id=event_id))
  return render_template('add_event.html', form=form)
Beispiel #3
0
def add_customer():
  form = VRForms.addcustomer()
  if form.validate_on_submit():
    lead = request.form.get('lead', False) == 'y'
    follow = request.form.get('follow', False) == 'y'
    customer_id = VRDB.customer_add(first_name=request.form['first_name'],
        last_name=request.form['last_name'],
        email=request.form['email'],
        lead=lead,
        follow=follow,
        signup_date=request.form['signup_date'],
        note=request.form['note'])
    return redirect(url_for('customer', customer_id=customer_id))
  return render_template('add_customer.html', form=form)
Beispiel #4
0
def list_customers():
  customers = VRDB.customers()
  return render_template('list_customers.html', customers=customers)
Beispiel #5
0
def customer(customer_id):
  customer = VRDB.customer(customer_id)
  form = VRForms.addcustomer(MultiDict(customer))
  return render_template('customer.html', form=form)
Beispiel #6
0
def list_events():
  events = VRDB.events()
  return render_template('list_events.html', events=events)