示例#1
0
文件: index.py 项目: souca/sixthdev
 def act_new_sale(self):
     #@TODO: come up with a real standard for new/adm/edit/whatever actions
     self.model = self.input
     import mdl_product
     mdl_product.doit()  #@TODO: FIX THIS!!
     self.consult("mdl_product")
     zebra.show("frm_sale", self.model)
示例#2
0
文件: index.py 项目: souca/sixthdev
 def list_product(self):
     # we want to see products in a particular node
     # (or in no nodes at all)
     nID = self.model["nodeID"] = int(self.input.get("nodeID", 0))
     import mdl_product
     mdl_product.nodeID = nID
     mdl_product.doit()
     if nID:
         self.model["path"] = Node(ID=self.model["nodeID"]).path
     self.consult(mdl_product.model)
     self.consult("mdl_category")
     zebra.show("lst_product", self.model)
示例#3
0
文件: index.py 项目: elmore/sixthdev
 def list_product(self):
     # we want to see products in a particular node
     # (or in no nodes at all)
     nID = self.model["nodeID"] = int(self.input.get("nodeID", 0))
     import mdl_product
     mdl_product.nodeID = nID
     mdl_product.doit()
     if nID:
         self.model["path"] = Node(ID=self.model["nodeID"]).path
     self.consult(mdl_product.model)
     self.consult("mdl_category")
     zebra.show("lst_product", self.model)
示例#4
0
 def prompt(self, message, action, hidden):
     import zebra
     model = {"message":message,
              "action":action,
              "hidden":hidden}
     zebra.show("frm_login",model)
示例#5
0
文件: index.py 项目: souca/sixthdev
 def list_sale(self):
     self.model = self.input
     self.consult("mdl_sale")
     self.model["includeFilled"] = int(self.input.get("includeFilled", 0))
     self.model["isSearch"] = 0
     zebra.show("lst_sale", self.model)
示例#6
0
文件: index.py 项目: souca/sixthdev
 def list_category(self):
     self.consult("mdl_category")
     zebra.show("lst_category", self.model)
示例#7
0
文件: index.py 项目: souca/sixthdev
 def exit(self):
     zebra.show("dsp_foot", self.model)
示例#8
0
文件: index.py 项目: souca/sixthdev
 def enter(self):
     self.model["popupHelp"] = popupHelp
     zebra.show("dsp_head", self.model)
示例#9
0
文件: index.py 项目: elmore/sixthdev
 def list_sale(self):
     self.model = self.input
     self.consult("mdl_sale")
     self.model["includeFilled"]=int(self.input.get("includeFilled",0))
     self.model["isSearch"]=0
     zebra.show("lst_sale", self.model)
示例#10
0
文件: index.py 项目: elmore/sixthdev
 def act_new_sale(self):
     #@TODO: come up with a real standard for new/adm/edit/whatever actions
     self.model = self.input
     import mdl_product; mdl_product.doit() #@TODO: FIX THIS!!
     self.consult("mdl_product")
     zebra.show("frm_sale", self.model)
示例#11
0
文件: index.py 项目: elmore/sixthdev
 def list_category(self):
     self.consult("mdl_category")
     zebra.show("lst_category", self.model)
示例#12
0
文件: index.py 项目: elmore/sixthdev
 def exit(self):
     zebra.show("dsp_foot",self.model)
示例#13
0
文件: index.py 项目: elmore/sixthdev
 def enter(self):
     self.model["popupHelp"] = popupHelp
     zebra.show("dsp_head",self.model)
示例#14
0
    else:
        raise hell
        #@TODO: unhardcode base directory for templates


import os, string
# get a list of all *.zb files in the directory, without the ".zb"
print tpldir()
tpls = map(
    lambda filename: filename[:-3],
    filter(lambda filename: filename[-3:] == ".zb", os.listdir(tpldir())))
tpls.sort()

which = weblib.request.get("which")

zebra.show("dsp_head")
print '<form action="templates.py" method="GET">'
print 'Choose a template to edit:'
print '<select name="which">'
for tpl in tpls:
    print '<option%s>%s</option>' % (("", " SELECTED")[tpl == which], tpl)
print '</select>'
print '<input type="submit" value="go">'
print '</form>'

if weblib.request.get("action") == "save":
    contents = weblib.request.get("contents")

    ## save the template...
    f = open(tpldir() + "/" + which + ".zb",
             "wb")  # binary more so as not to add extra ^M's on win32
示例#15
0
    else:
        raise hell
        #@TODO: unhardcode base directory for templates


import os, string
# get a list of all *.zb files in the directory, without the ".zb"
print tpldir()
tpls = map(lambda filename: filename[:-3], 
           filter(lambda filename: filename[-3:] == ".zb",
                  os.listdir(tpldir())))
tpls.sort()

which = weblib.request.get("which")

zebra.show("dsp_head")
print '<form action="templates.py" method="GET">'
print 'Choose a template to edit:'
print '<select name="which">'
for tpl in tpls:
    print '<option%s>%s</option>' % ((""," SELECTED")[tpl==which], tpl)
print '</select>'
print '<input type="submit" value="go">'
print '</form>'

if weblib.request.get("action") == "save":
    contents = weblib.request.get("contents")

    ## save the template...
    f = open(tpldir() + "/" + which + ".zb",
             "wb") # binary more so as not to add extra ^M's on win32