我使用SSDT进行数据库部署。我从部署后脚本中添加了静态数据。虽然有很多数据,但如果没有必要,我也不希望这样做。
基本上我需要的是:class RegisterNewAppointmentFrameStep2( wx.Frame ):
def __init__( self, parent, firstName ):
global cursor
wx.Frame.__init__( self, parent = parent , id = -1, title = u'Marcação de consulta', size = ( 271, 138 ),
style = wx.DEFAULT_FRAME_STYLE ^ ( wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX ) )
#Centers this RegisterNewAppointmentFrameStep2:
self.Center()
#Creates panel as a child of this RegisterNewAppointmentFrameStep2:
self.panel = wx.Panel( parent = self )
#Query to determine all patients with the first name provided:
results = cursor.execute( 'SELECT * FROM Paciente WHERE Primeiro_Nome = ( ? )', ( firstName, ) )
results = results.fetchall()
size = len( results )
if size > 1: #size >= 2.
self.instructionsLabel = wx.StaticText( self.panel, -1, '%d pacientes encontrados. Por favor selecione\nabaixo o sobrenome do paciente desejado.' % size,
pos = ( 10, 10 ), size = ( 700, 200 ) )
self.firstNameLabel = wx.StaticText( self.panel, -1, firstName, pos = ( 10, 50 ) )
comboBoxValues = []
for result in results:
comboBoxValues.append( result[ 2 ] )
self.dropDownList = wx.ComboBox( parent = self, id = -1, pos = ( 70, 50 ), size = ( 163, -1 ), choices = comboBoxValues, style = wx.CB_READONLY | wx.CB_SORT )
boxSizer = wx.BoxSizer( wx.HORIZONTAL )
boxSizer.Add( self.instructionsLabel, 1, wx.EXPAND )
boxSizer.Add( self.firstNameLabel, 1, wx.EXPAND )
boxSizer.Add( self.dropDownList, 1, wx.EXPAND )
最好的方法是什么?