Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 def prompt(self, message, action, hidden):
     import zebra
     model = {"message":message,
              "action":action,
              "hidden":hidden}
     zebra.show("frm_login",model)
Example #5
0
 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)
Example #6
0
 def list_category(self):
     self.consult("mdl_category")
     zebra.show("lst_category", self.model)
Example #7
0
 def exit(self):
     zebra.show("dsp_foot", self.model)
Example #8
0
 def enter(self):
     self.model["popupHelp"] = popupHelp
     zebra.show("dsp_head", self.model)
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
 def list_category(self):
     self.consult("mdl_category")
     zebra.show("lst_category", self.model)
Example #12
0
 def exit(self):
     zebra.show("dsp_foot",self.model)
Example #13
0
 def enter(self):
     self.model["popupHelp"] = popupHelp
     zebra.show("dsp_head",self.model)
Example #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
Example #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