Beispiel #1
0
#coding:utf-8
from __future__ import unicode_literals  
from utils import route_app
from utils import render
from utils import nextid
from utils import get_db
from utils import errorpage
from utils import encrypt
from utils import decrypt
from settings import log
import web
import forms
import models


app  = route_app()

@app.route("")
class routeto():
    def GET(self):
        web.header("Content-Type","text/html; charset=utf-8")
        nodes = get_db().query(models.RadNode).all()
        return render("node.html",nodes=nodes) 

@app.route("/delete/(.*)")
class index():
    """删除节点及节点下的操作员"""
    def GET(self,nodeid):
        if nodeid:
            db = get_db()
            try:
Beispiel #2
0
#!/usr/bin/env python
#coding:utf-8
from __future__ import unicode_literals
from utils import route_app
from utils import render
from utils import get_db
from utils import errorpage
from settings import log
from decimal import Decimal
import web
import forms
import models

app = route_app()


@app.route("")
class routeto():
    def GET(self):
        web.header("Content-Type", "text/html; charset=utf-8")
        products = get_db().query(models.RadProduct).all()
        return render("product.html", products=products)


@app.route("/add")
class index():
    def GET(self):
        web.header("Content-Type", "text/html; charset=utf-8")
        form = forms.product_add_form()
        return render("baseform.html",
                      form=form,