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)
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)
def prompt(self, message, action, hidden): import zebra model = {"message":message, "action":action, "hidden":hidden} zebra.show("frm_login",model)
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)
def list_category(self): self.consult("mdl_category") zebra.show("lst_category", self.model)
def exit(self): zebra.show("dsp_foot", self.model)
def enter(self): self.model["popupHelp"] = popupHelp zebra.show("dsp_head", self.model)
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)
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)
def exit(self): zebra.show("dsp_foot",self.model)
def enter(self): self.model["popupHelp"] = popupHelp zebra.show("dsp_head",self.model)
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
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