Exemplo n.º 1
0
def apps_new():
    form = forms.AppForm()
    if form.validate_on_submit():
        models.apps_new(form)
        return redirect('/apps')

    form.app_id.data = models.auto_created()
    form.app_id.readonly = True
    form.app_key.data = models.auto_created()
    form.app_key.readonly = True
    form.app_secret.data = models.auto_created()
    form.app_secret.readonly = True
    form.facebook_api_version.choices = models.facebook_api_version_choices()
    form.status.choices = models.app_status_choices()
    
    return render_template('apps/apps_edit.html',
                           form = form, h = helpers)
Exemplo n.º 2
0
def products_new(app_id):
    form = forms.ProductForm()
    if form.validate_on_submit():
        models.products_new(form)
        return redirect('/apps/%d/products' % (app_id))

    form.app_id.data = app_id
    form.app_id.readonly = True
    form.product_id.data = models.auto_created()
    form.product_id.readonly = True
    form.service_platform.choices = models.service_platform_choices()
    form.currency.choices = models.currency_type_choices()
    form.status.choices = models.product_status_choices()

    return render_template('apps/products_edit.html',
                           app_id = app_id,
                           form = form, h = helpers)