def __init__(self, parent, title, fileName=None): # Initialize frame wx.Frame.__init__(self, parent, title='complex BIO gui in development', size=(1125, 600)) self.VarInit() self.tools = gpi.GetPlugIns(self.hD + r"\Plugins\Tools") self.views = gpi.GetPlugIns(self.hD + r"\Plugins\Views") self.GetColors() self.SetBackgroundColour(self.colorList['Main']['Back']) mts = mtbs.MenuToolBarSetup(self, self.tools, self.hD) self.toolIDs = mts.GetIDs() mts.DoMenubar("", "", False, False, False, True) mts.DoToolbar() self.SetButtons() self.SetViewWindows() self.SetMainPanels() self.SetViewTypes() self.listView = lv.ListView() self.listView.Init(self, self.top, self.hD, self.colorList) self.curView = self.views[self.viewTypes['Amino Acids'][0]].Plugin() self.curView.Init(self, self.bottom, self.colorList) self.OnSelect(wx.EVT_IDLE) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_CLOSE, self.DoExit) # Prompt user before closing frame """Leave untouched until ready
def crashed_truck_last_delivered(self, truckid): self.clear() self.header(back='extraqueries') title = "Truck %s" % (truckid) self.columns=['Package ID', 'Time'] query = "select \"package.id\", time from last_truck_delivery(%s)" % (truckid) dictlist=self.dbconnector.querydictlist(query, self.columns) extraquerypage=ListView.listview(self,title,self.columns,dictlist)
def crashed_truck_packages(self, truckid): self.clear() self.header(back='extraqueries') title = "Truck %s" % (truckid) self.columns=['Package ID', 'First Name', 'Last Name'] query = "select * from truck_crash(%s)" % (truckid) dictlist=self.dbconnector.querydictlist(query, self.columns) extraquerypage=ListView.listview(self,title,self.columns,dictlist)
def most_shipping_spent(self): self.clear() self.header(back='extraqueries') title = "Customer" self.columns=['First Name','Last Name', 'Cost'] query = 'select account.first_name, account.last_name, most_shipping_spent.cost from most_shipping_spent() inner join account on account.id=most_shipping_spent.id' dictlist=self.dbconnector.querydictlist(query, self.columns) extraquerypage=ListView.listview(self,title,self.columns,dictlist)
def address_page(self): self.clear() self.header(back='settings') title="Addresses" self.columns=['Number', 'Apartment', 'Street', 'Territory', 'State', 'Zip', 'Country'] query= "select number, apartment, street, city, territory, zip_code, country from address where \"account.ID\" = %s" % (self.userdict['id']) dictlist=self.dbconnector.querydictlist(query, self.columns) creditcardpage=ListView.listview(self, title, self.columns, dictlist, idbutton=False)
def credit_card_page(self): self.clear() self.header(back='settings') title="Credit Cards" self.columns=['Card Number', 'Expiration Date'] query= "select RIGHT(CAST(card_number as varchar), 4), expiration_date from credit_card where \"account.ID\" = %s" % (self.userdict['id']) dictlist=self.dbconnector.querydictlist(query, self.columns) creditcardpage=ListView.listview(self, title, self.columns, dictlist, idbutton=False)
def street_most_customers(self): self.clear() self.header(back='extraqueries') title = "Street" self.columns=['Street','City','Zip Code'] query = "select street, city, zip_code from street_most_customers()" dictlist=self.dbconnector.querydictlist(query, self.columns) extraquerypage=ListView.listview(self,title,self.columns,dictlist)
def customer_most_packages(self): self.clear() self.header(back='extraqueries') title = "Customer" self.columns=['First Name','Last Name', 'Email', 'Phone'] query = "select first_name, last_name, email, phone_number from account where id = most_shipped_account()" dictlist=self.dbconnector.querydictlist(query, self.columns) extraquerypage=ListView.listview(self,title,self.columns,dictlist)
def location_history_page(self, packageid): self.clear() self.header(back="package." + packageid) title="Location History" self.columns=['Shipping Center', 'Plane', 'Truck', 'Description', 'Updated'] query = "select \"shipping_center.id\", \"plane.id\", \"truck.id\", description, time from package_location where \"package.id\" = %s" % packageid dictlist=self.dbconnector.querydictlist(query, self.columns) if self.userdict['shippingcenter'] is not None: footer=self.footer(footerbutton='Update Location', package=packageid) locationpage=ListView.listview(self, title, self.columns, dictlist, idbutton=False)
def settings_page(self): self.clear() self.header() title="Settings" self.columns=['First Name','Last Name', 'Email', 'Phone'] query= "select first_name, last_name, email, phone_number from account where id = %s" % (self.userdict['id']) dictlist=self.dbconnector.querydictlist(query, self.columns) if self.userdict['shippingcenter'] is not None: dictlist[0]['Shipping Center']=self.userdict['shippingcenter'] footer=self.footer(footerbutton='Extra Queries') else: footer=self.footer(footerbutton='Settings') settingspage=ListView.listview(self, title, self.columns, dictlist)
def home_page(self): self.clear() self.header() self.columns=None title='' query='' if self.userdict['shippingcenter'] is not None: title="Packages at %s" % (self.userdict['shippingcenter']) self.columns = ['Package ID','Delivery Date', 'Updated', 'Location'] query = "select package.id, package.delivery_date, package_location.time, package_location.description from package inner join package_location on package.id = package_location.\"package.id\" where package_location.\"shipping_center.id\"= %s" % (self.userdict['shippingcenter']) else: title="Orders" self.columns = ['Tracking #','Delivery Date','Status','Total'] query = "select tracking_number, date, status, 0 from shipping_order WHERE account_ID = %s" % (self.userdict['id']) dictlist=self.dbconnector.querydictlist(query, self.columns) homepage=ListView.listview(self, title, self.columns, dictlist)
def order_page(self, orderid): self.clear() self.header(back=None) title="Order %s" % str(orderid) self.columns = ['Package','Delivery Date','Status'] footerquery = "select tracking_number, date, status from shipping_order WHERE account_ID = %s;" % (orderid) footerdictlist=self.dbconnector.querydictlist(footerquery, self.columns) ordertotalquery="select * from total_order_cost(%s)" % (orderid) ordertotalresult=self.dbconnector.makequery(ordertotalquery)[0][0] footerdictlist[0]['Total']=ordertotalresult self.columns.append('Total') self.footer(footerdictlist=footerdictlist[0]) query = "select id, delivery_date, 'false' as status, cost+shipping_cost as total from package where \"shipping_order.tracking_number\"=%s;" % orderid dictlist=self.dbconnector.querydictlist(query, self.columns) orderpage=ListView.listview(self, title, self.columns, dictlist, orderid=orderid)
def package_page(self, packageid, orderid): self.clear() if(self.userdict['shippingcenter']): self.header(back=None) else: self.header(back=orderid) title="Package %s" % str(packageid) self.columns=['Cost', 'Shipping Cost', 'Total', 'International', 'Hazardous'] query = "select cost, shipping_cost, cost + shipping_cost as total, international, hazardous from package where id=%s;" % packageid dictlist=self.dbconnector.querydictlist(query, self.columns)[0] self.columns=['Shipping Center', 'Plane', 'Truck', 'Description', 'Updated'] packagequery = "select \"shipping_center.id\", \"plane.id\", \"truck.id\", description, time from curr_location(%s)" % packageid dictlist2=self.dbconnector.querydictlist(packagequery, self.columns)[0] dictlist.update(dictlist2) if (dictlist['Shipping Center'] == 'None'): del dictlist['Shipping Center'] if (dictlist['Plane'] == 'None'): del dictlist['Plane'] if (dictlist['Truck'] == 'None'): del dictlist['Truck'] footer=self.footer(package=packageid) packagepage=ListView.listview(self, title, self.columns, [dictlist])
from djangfrom django.conf.urls import url, include from djangfrom django.views.generic import ListView, DetailView from blog.from blog.models import Post, Bekonomi, Bsains urlpatternurlpatterns = [url(r'^$', ListView.as_view(queryset=Post.objects.all().order_by("-date")[:25], template_name="blog/blog.html")), url(r'^(?P<pk>\d+)$',DetailView.as_view(model=Post, template_name = 'blog/post.html'))]
def extra_queries(self): self.clear() self.header(back='settings') title="Extra Queries" self.columns=['Description', 'Parameter', 'Submit'] extraqueriespage=ListView.listview(self, title, self.columns, [])
#encoding:utf-8 from Tkinter import * from ListView import * root = Tk() def addData(): print 1 def modifyData(): print 1 Button(root,text='add',command=addData).grid(row=0,column=0,sticky=W) Button(root,text='modify',command=modifyData).grid(row=0,column=1,sticky=E) tree = ListView(root) tree.grid(row=1,column=0,columnspan=2) cols = [{"key":"ip","width":100,"text":"IP"},{"key":"mac","width":100,"text":"Mac"}] tree.initColumn(cols) row={"identifyKey":"ip","ip":"172.17.2.150","mac":"012345678912"} tree.insertRow(row) row={"identifyKey":"ip","ip":"172.17.2.152","mac":"012345678913"} tree.insertRow(row) root.mainloop()
def extra_query_page(self, title, columns, dictlist): self.clear() self.header(back='extraqueries') self.columns=columns extraquerypage=ListView.listview(self,title,self.columns,dictlist)