• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python models.SqlHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中models.SqlHandler的典型用法代码示例。如果您正苦于以下问题:Python SqlHandler类的具体用法?Python SqlHandler怎么用?Python SqlHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SqlHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent=None, item=None):
        owner = None
        animal = None
        #check if item is dictionary. So it is called by ownerTab
        if(item != None and item.__class__.__name__ == 'dict'):
            if("owner" in item):
                owner = item["owner"]
            if("animal" in item):
                animal = item["animal"]
            item = None

        GenericTab.__init__(self, parent=parent, item=item)
        self.ui = Ui_Visit()
        self.ui.setupUi(self)
        self.ui.stackedWidget.setCurrentIndex(0) #TODO:remove if needed

        self.currentVisitAnimal = None
        self.currentOperation = None
        
        self.configure()
        self.createConnections()

        self.setBasicInfo()
        if(owner != None):
            owner = SqlHandler.makeCopy(self.session,owner)
            self.ownerserachline.setCurrentItem(owner)
            if(animal != None):
                animal = SqlHandler.makeCopy(self.session,animal)
                self.animalTreeWidget.addAskedItem(animal) #TODO find function to add animal
            self.disableAnimalTree(False)
开发者ID:mape90,项目名称:VetApp,代码行数:30,代码来源:visittab.py


示例2: saveNewItem

 def saveNewItem(self):
     specie = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex())
     if specie != None:
         SqlHandler.addItem(self.session, SqlHandler.Color(self.ui.lineEdit.text(), specie.id))
         if self.parent().specieName() == specie.name:
             self.parent().setColor(self.ui.lineEdit.text())
     self.closeDialog()
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:addNewDialog.py


示例3: deleteItemFromSearch

 def deleteItemFromSearch(self):
     item = self.itemSearchEdit.getCurrentItem()
     if item and self.askUser():
         if self.itemCanBeDeleted(item):
             SqlHandler.removeItem(self.session, item)
         else:
             pass #error
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:itemcreatortab.py


示例4: setPrices

    def setPrices(self, visit):
        price_dict = visit.getPriceDict()

        self.ui.operationSpinBox.setValue(price_dict["operation_price"] * (100+SqlHandler.getALV(1))/100.)
        self.ui.accessoriesSpinBox.setValue(price_dict["accesories_price"] * (100+SqlHandler.getALV(1))/100.)
        self.ui.labSpinBox.setValue( price_dict["lab_price"] * (100+SqlHandler.getALV(1))/100.)
        self.ui.medicineSpinBox.setValue(price_dict["medicine_price"] * (100+SqlHandler.getALV(2))/100.)
        self.ui.dietSpinBox.setValue(price_dict["diet_price"] * (100+SqlHandler.getALV(3))/100.)
开发者ID:mape90,项目名称:VetApp,代码行数:8,代码来源:billTab.py


示例5: saveDialog

 def saveDialog(self):
     if self.animalsearch.getCurrentItem() != None:
         if self.item != None:
             self.item.update()
             self.parent().update()
             self.closeDialog()
         else:
             self.item = SqlHandler.PhoneRecipie(self.animalsearch.getCurrentItem(), self.recipieMedicineTreeWidget.getItemsFromList())
             self.item.update(self.getData())
             SqlHandler.addItem(self.session, self.item)
             self.parent().update()
             self.closeDialog()
开发者ID:mape90,项目名称:VetApp,代码行数:12,代码来源:generictreewidget.py


示例6: getData

    def getData(self):
        print("DEBUG: getData")
        data = {}
        data['visit'] = self.visit
        if self.ui.clinic_radio_button.isChecked():
            data['clinic_payment'] = self.ui.clinicPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
            data['km'] = 0.0
            data['km_payment'] = 0.0
        else:
            data['clinic_payment'] = self.ui.visitPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
            data['km'] = self.ui.KmSpinBox.value()
            data['km_payment'] = self.ui.KmPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)

        data['operations_payment'] = self.ui.operationSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
        data['lab_payment'] = self.ui.labSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
        data['accessories_payment'] = self.ui.accessoriesSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
        data['extra_percent'] = self.ui.precentSlider.value()
        data['medicines_payment'] = self.ui.medicineSpinBox.value() / ((100+SqlHandler.getALV(2))/100.)
        data['diet_payment'] = self.ui.dietSpinBox.value() / ((100+SqlHandler.getALV(3))/100.)
        data['payment_method'] = (self.ui.paymentComboBox.itemData(self.ui.paymentComboBox.currentIndex()))
        data['due_date'] = self.qdateToPy(self.ui.DueDateEdit.date())
        data['paid_time'] = self.qdateToPy(self.ui.paidDateEdit.date())
        data['paid_value'] = self.ui.paidSpinBox.value()
        data['index_number'] = self.ui.indexNumberLabel.text()
        data['other_info'] = self.ui.otherInfoTextEdit.toPlainText()
        data['satus'] = 0 #status TODO: implement if needed
        
        print('operations_payment ',data['operations_payment'])
        
        return data
开发者ID:mape90,项目名称:VetApp,代码行数:30,代码来源:billTab.py


示例7: __init__

 def __init__(self, parent=None, item=None, animal=None):
     from uipy.ui_phonerecipiedialog import Ui_PhoneRecipieDialog
     QDialog.__init__(self, parent=parent)
     self.ui = Ui_PhoneRecipieDialog()
     self.ui.setupUi(self)
     self.session = SqlHandler.newSession()
     self.item = item
     self.animal = None
     if animal != None:
         self.animal = SqlHandler.makeCopy(self.session, animal)
     
     self.configure()
     self.createConnections()
     self.setBasicInfo()
开发者ID:mape90,项目名称:VetApp,代码行数:14,代码来源:generictreewidget.py


示例8: updateEndPrice

 def updateEndPrice(self):
     price_ALV1 = self.getALV1Price() * (100+SqlHandler.getALV(1))/100.
     price_ALV2 = self.getALV2Price() * (100+SqlHandler.getALV(2))/100.
     price_ALV3 = self.getALV3Price() * (100+SqlHandler.getALV(3))/100.
     
     self.ui.price_ALV1_total_label.setText('%.2f' % price_ALV1)
     self.ui.ALV1_total.setText('%.2f' % (price_ALV1-self.getALV1Price()))
     
     self.ui.price_ALV2_total_label.setText('%.2f' % price_ALV2)
     self.ui.ALV2_total.setText('%.2f' % (price_ALV2-self.getALV2Price()))
     
     self.ui.price_ALV3_total_label.setText('%.2f' % price_ALV3)
     self.ui.ALV3_total.setText('%.2f' % (price_ALV3-self.getALV3Price()))
     
     self.ui.endPriceLabel.setText('%.2f' % (price_ALV1 + price_ALV2 + price_ALV3))
开发者ID:mape90,项目名称:VetApp,代码行数:15,代码来源:billTab.py


示例9: setSpecie

 def setSpecie(self):
     for specie in SqlHandler.searchSpecie(self.session):
         self.ui.comboBox.addItem(specie.name, specie)
     
     current = self.ui.comboBox.findText(self.parent().specieName())
     if current > 0:
         self.ui.comboBox.setCurrentIndex(current)
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:addNewDialog.py


示例10: __init__

 def __init__(self, parent=None):
     QDialog.__init__(self, parent=parent)
     self.ui = Ui_LoginDialog()
     self.ui.setupUi(self)
     self.session = SqlHandler.newSession()
     self.configureConnections();
     self.setVets()
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:login_dialog.py


示例11: __init__

    def __init__(self, parent=None,item=None):
        GenericTab.__init__(self, parent=parent, item=None)
        self.ui = Ui_SummaryTab()
        self.ui.setupUi(self)
        self.returnItem = False
        self.visitanimal = None

        if type(item) is dict:
            if 'owner' in item:
                self.ui.ownerNameLabel.setText(item['owner'].name)
            else:
                logERROR(self, "SummaryTab.init: owner not found from dict")
            if 'visitanimal' in item:
                self.visitanimal = item['visitanimal']
                self.ui.animalNameLabel.setText(item['visitanimal'].animal.name)
            else:
                logERROR(self, "SummaryTab.init: owner not found from dict")
            if 'text' in item:
                self.addText(item['text'])
            else:
                logERROR(self, "SummaryTab.init: text not found from dict")
        else:
            logDEBUG(self, "SummaryTab.init: item is not dict it is: "+ item)
        
        self.session = SqlHandler.newSession()
        
        self.itemSearchEdit = SearchLineEdit(tabcreator=AddNewSummary, 
                                             session=self.session, 
                                             parent=self, 
                                             function=SqlHandler.searchSummary)
        
        self.configure()
        self.configureConnctions()
开发者ID:mape90,项目名称:VetApp,代码行数:33,代码来源:summarytab.py


示例12: genTableRow

 def genTableRow(self, operation):
     counter = 0
     tmp_rows = ''
     tmp_rows += self.genTableRowPrue(name = operation.base.name,
                                     count = operation.count,
                                     type_ = "kpl",
                                     price = operation.price,
                                     alv = SqlHandler.getALV(1))
     counter += 1
     if(hasattr(operation.base, 'item')):
         print("operation.base.item: ", operation.base.item)
         tmp_rows += self.genTableRowPrue(name = ('- ' + operation.base.item.name),
                                          count = operation.count,
                                          type_ = operation.base.item.count_type,
                                          price = operation.base.item.price,
                                          alv = operation.base.item.getALV())
         counter += 1
     if(hasattr(operation, 'items')):
         print("items listing strt")
         for surgeryitem in operation.items:
             total_count = operation.count*surgeryitem.count
             
             tmp_rows += self.genTableRowPrue(name = ('- ' + surgeryitem.item.name),
                                             count = total_count,
                                             type_ = surgeryitem.item.count_type,
                                             price = surgeryitem.item.price,
                                             alv = surgeryitem.item.getALV())
             counter += 1
     
     return (tmp_rows, counter)
开发者ID:mape90,项目名称:VetApp,代码行数:30,代码来源:printFileCreator.py


示例13: setRace

 def setRace(self, newName=''):
     self.ui.raceBox.clear()
     self.ui.raceBox.addItem('', None)
     specie = self.specie()
     if specie != None:
         for race in SqlHandler.searchRace(self.session, specie.id):
             self.ui.raceBox.addItem(race.name, race)  
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:searchtab.py


示例14: setColor

 def setColor(self):
     self.ui.colorBox.clear()
     self.ui.colorBox.addItem('', None)
     specie = self.specie()
     if specie != None:
         for color in SqlHandler.searchColor(self.session, specie.id):
             self.ui.colorBox.addItem(color.name, color)
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:searchtab.py


示例15: setVet

 def setVet(self):
     self.ui.billVetBox.clear()
     self.ui.visitVetBox.clear()
     self.ui.visitVetBox.addItem('',None)
     self.ui.billVetBox.addItem('',None)
     for vet_temp in SqlHandler.searchVet(self.session):
         self.ui.visitVetBox.addItem(vet_temp.name, vet_temp)
         self.ui.billVetBox.addItem(vet_temp.name, vet_temp)
开发者ID:mape90,项目名称:VetApp,代码行数:8,代码来源:searchtab.py


示例16: setPostOffice

 def setPostOffice(self):
     for postoffice in SqlHandler.searchPostOffice(self.session):
         self.ui.comboBox.addItem(postoffice.name, postoffice)
     
     current = self.ui.comboBox.findText(self.parent().postOfficeName())
     if current > 0:
         self.ui.comboBox.setCurrentIndex(current)
             
开发者ID:mape90,项目名称:VetApp,代码行数:7,代码来源:addNewDialog.py


示例17: __init__

 def __init__(self, parent, item=None, deftype='Item'):
     QDialog.__init__(self,parent=parent)
     self.ui = Ui_ItemCreatorDialog()
     self.ui.setupUi(self)
     self.session = SqlHandler.newSession()
     self.deftype = deftype
     
     self.item = item
     if self.item != None:
         self.item = SqlHandler.makeCopy(self.session, self.item)
         self.session.add(self.item)
     
     self.configure()
     self.configureConnections()
     self.setBasicInfo()
     
     self.selectCorrectItem()
开发者ID:mape90,项目名称:VetApp,代码行数:17,代码来源:itemcreatordialog.py


示例18: setAlv1Names

 def setAlv1Names(self):
     alv = str(SqlHandler.getALV(1))
     self.ui.ALV1_1.setText(alv + '%')
     self.ui.ALV1_2.setText(alv + '%')
     self.ui.ALV1_3.setText(alv + '%')
     self.ui.ALV1_4.setText(alv + '%')
     #self.ui.ALV1_5.setText(alv + '%')
     self.ui.ALV1_6.setText(alv + '%')
     self.ui.ALV1_7.setText(alv + '%')
开发者ID:mape90,项目名称:VetApp,代码行数:9,代码来源:billTab.py


示例19: setVets

 def setVets(self, vet=None): #TODO: select last used vet
     self.ui.vetComboBox.clear()
     
     for vet_temp in SqlHandler.searchVet(self.session):
         self.ui.vetComboBox.addItem(vet_temp.name, vet_temp)
         if vet != None and vet.name == vet_temp.name:
             tmp_index = self.ui.vetComboBox.findText(vet_temp.name)
             if tmp_index >= 0:
                 self.ui.vetComboBox.setCurrentIndex(tmp_index)
开发者ID:mape90,项目名称:VetApp,代码行数:9,代码来源:login_dialog.py


示例20: setSpecie

 def setSpecie(self, newName=''):   
     self.ui.specieComboBox.clear()
     self.ui.specieComboBox.addItem('', None)
     
     for specie in SqlHandler.searchSpecie(self.session):
         self.ui.specieComboBox.addItem(specie.name, specie)
     
     if len(newName):
         self.ui.specieComboBox.setCurrentIndex(self.ui.specieComboBox.findText(newName))
开发者ID:mape90,项目名称:VetApp,代码行数:9,代码来源:itemcreatordialog.py



注:本文中的models.SqlHandler类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python models.State类代码示例发布时间:2022-05-27
下一篇:
Python models.Sporocilo类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap