Changeset 181
- Timestamp:
- 14/08/09 14:39:49 (4 years ago)
- File:
-
- 1 edited
-
trunk/legajosocial.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/legajosocial.py
r180 r181 5 5 import wx 6 6 import wx.grid 7 import MySQLdb 7 8 8 9 # begin wxGlade: extracode … … 16 17 kwds["style"] = wx.DEFAULT_FRAME_STYLE 17 18 wx.Frame.__init__(self, *args, **kwds) 19 self.db = MySQLdb.connect('localhost', 'javier', 'javier', 'escuela', charset='UTF8') 18 20 self.panel = wx.Panel(self, -1) 19 21 self.lblLegajo = wx.StaticText(self.panel, -1, "Legajo Social") … … 22 24 self.nombres = wx.TextCtrl(self.panel, -1, "") 23 25 self.labelApellidos = wx.StaticText(self.panel, -1, "Fecha nac.:") 24 self. datepickerFechaNac = wx.DatePickerCtrl(self.panel, -1)26 self.fechaNac = wx.DatePickerCtrl(self.panel, -1) 25 27 self.labelLugarNac = wx.StaticText(self.panel, -1, "Lugar Nac. :") 26 28 self.lugarNac = wx.TextCtrl(self.panel, -1, "") 27 29 self.labelEstadoCivil = wx.StaticText(self.panel, -1, "Estado Civil:") 28 self. comboEstadoCivil = wx.ComboBox(self.panel, -1, choices=["Soltero/a", "Casado/a", "En pareja (conviviendo)", "En pareja (sin convivir)", "Separado/a", "Divorciado/a", "Viudo/a"], style=wx.CB_DROPDOWN|wx.CB_READONLY)30 self.estadoCivil = wx.ComboBox(self.panel, -1, choices=["Soltero/a", "Casado/a", "En pareja (conviviendo)", "En pareja (sin convivir)", "Separado/a", "Divorciado/a", "Viudo/a"], style=wx.CB_DROPDOWN|wx.CB_READONLY) 29 31 self.labelDomicilio = wx.StaticText(self.panel, -1, "Domicilio:") 30 32 self.domicilio = wx.TextCtrl(self.panel, -1, "") … … 32 34 self.telefono = wx.TextCtrl(self.panel, -1, "") 33 35 self.checkPlan = wx.CheckBox(self.panel, -1, "Plan Social") 34 self. comboPlanSocial = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN)36 self.planSocial = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 35 37 self.checkPlanFamiliar = wx.CheckBox(self.panel, -1, "Familiar") 36 self. comboPlanFamiliar = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN)38 self.planFamiliar = wx.ComboBox(self.panel, -1, choices=["Plan Trabajar", "Plan Jefas y jefes", "Fines"], style=wx.CB_DROPDOWN) 37 39 self.labelEmpleo = wx.StaticText(self.panel, -1, "Empleo:") 38 self. combo_box_1= wx.ComboBox(self.panel, -1, choices=["Empleado/a (Rel. dependencia)", u"Empleado/a (Contrato a término)", "Empleado/a (Informal)", u"ChangarÃn", "Cuentapropista/a", "Empresario/a", "Comerciante", "Empleado/a casa de familia", "Desocupado/a"], style=wx.CB_DROPDOWN)40 self.empleo = wx.ComboBox(self.panel, -1, choices=["Empleado/a (Rel. dependencia)", u"Empleado/a (Contrato a término)", "Empleado/a (Informal)", u"ChangarÃn", "Cuentapropista/a", "Empresario/a", "Comerciante", "Empleado/a casa de familia", "Desocupado/a"], style=wx.CB_DROPDOWN) 39 41 self.labelEmpresa = wx.StaticText(self.panel, -1, u"Ubicación:") 40 42 self.empresa = wx.TextCtrl(self.panel, -1, "") … … 50 52 self.labelFamilia = wx.StaticText(self.panel, -1, "Grupo Familiar -->") 51 53 self.checkDeporte = wx.CheckBox(self.panel, -1, "Deportes") 52 self.deportes = wx.TextCtrl(self.panel, -1, u"Qué deporte y en qué lugar...")54 self.deportesdonde = wx.TextCtrl(self.panel, -1, u"Qué deporte y en qué lugar...") 53 55 self.labelTiempoLibre = wx.StaticText(self.panel, -1, "Tiempo libre:") 54 56 self.hobbyes = wx.TextCtrl(self.panel, -1, "") … … 83 85 self.SetTitle("Sancabase - Legajo Social") 84 86 self.SetSize((800, 600)) 87 self.CenterOnScreen() 85 88 self.lblLegajo.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD, 0, "")) 86 89 self.nombres.SetFocus() 87 self. comboEstadoCivil.SetSelection(-1)88 self. comboPlanSocial.Enable(False)89 self. comboPlanSocial.SetSelection(0)90 self. comboPlanFamiliar.Enable(False)91 self. comboPlanFamiliar.SetSelection(0)92 self. combo_box_1.SetSelection(0)90 self.estadoCivil.SetSelection(-1) 91 self.planSocial.Enable(False) 92 self.planSocial.SetSelection(0) 93 self.planFamiliar.Enable(False) 94 self.planFamiliar.SetSelection(0) 95 self.empleo.SetSelection(0) 93 96 self.motivoAbandono.Enable(False) 94 97 self.escuelaActual.Enable(False) 95 98 self.cursosFP.Enable(False) 96 self.deportes .Enable(False)99 self.deportesdonde.Enable(False) 97 100 self.judiciales.Enable(False) 98 101 self.gridFamilia.CreateGrid(10, 5) … … 127 130 gridDatosPersonales.Add(self.nombres, 0, wx.EXPAND, 0) 128 131 gridDatosPersonales.Add(self.labelApellidos, 0, wx.ALL, 1) 129 gridDatosPersonales.Add(self. datepickerFechaNac, 0, wx.ALL|wx.EXPAND, 1)132 gridDatosPersonales.Add(self.fechaNac, 0, wx.ALL|wx.EXPAND, 1) 130 133 gridDatosPersonales.Add(self.labelLugarNac, 0, wx.ALL, 1) 131 134 gridDatosPersonales.Add(self.lugarNac, 0, wx.ALL|wx.EXPAND, 1) 132 135 gridDatosPersonales.Add(self.labelEstadoCivil, 0, wx.ALL, 1) 133 gridDatosPersonales.Add(self. comboEstadoCivil, 0, wx.ALL|wx.EXPAND, 1)136 gridDatosPersonales.Add(self.estadoCivil, 0, wx.ALL|wx.EXPAND, 1) 134 137 gridDatosPersonales.Add(self.labelDomicilio, 0, wx.ALL, 1) 135 138 gridDatosPersonales.Add(self.domicilio, 0, wx.ALL|wx.EXPAND, 1) … … 137 140 gridDatosPersonales.Add(self.telefono, 0, wx.ALL|wx.EXPAND, 1) 138 141 gridDatosPersonales.Add(self.checkPlan, 0, wx.ALL, 1) 139 gridDatosPersonales.Add(self. comboPlanSocial, 0, wx.ALL|wx.EXPAND, 1)142 gridDatosPersonales.Add(self.planSocial, 0, wx.ALL|wx.EXPAND, 1) 140 143 gridDatosPersonales.Add(self.checkPlanFamiliar, 0, wx.ALL, 1) 141 gridDatosPersonales.Add(self. comboPlanFamiliar, 0, wx.ALL|wx.EXPAND, 1)144 gridDatosPersonales.Add(self.planFamiliar, 0, wx.ALL|wx.EXPAND, 1) 142 145 gridDatosPersonales.Add(self.labelEmpleo, 0, wx.ALL, 1) 143 gridDatosPersonales.Add(self. combo_box_1, 0, wx.ALL|wx.EXPAND, 1)146 gridDatosPersonales.Add(self.empleo, 0, wx.ALL|wx.EXPAND, 1) 144 147 gridDatosPersonales.Add(self.labelEmpresa, 0, wx.ALL, 1) 145 148 gridDatosPersonales.Add(self.empresa, 0, wx.ALL|wx.EXPAND, 1) … … 157 160 sizerMedio.Add(gridDatosPersonales, 1, wx.RIGHT|wx.EXPAND, 14) 158 161 grid_sizer_1.Add(self.checkDeporte, 0, wx.ALL, 1) 159 grid_sizer_1.Add(self.deportes , 0, wx.ALL|wx.EXPAND, 1)162 grid_sizer_1.Add(self.deportesdonde, 0, wx.ALL|wx.EXPAND, 1) 160 163 grid_sizer_1.Add(self.labelTiempoLibre, 0, wx.ALL, 1) 161 164 grid_sizer_1.Add(self.hobbyes, 0, wx.ALL|wx.EXPAND, 1) … … 206 209 207 210 def OnAceptar(self, event): # wxGlade: LegajoSocial.<event_handler> 208 print "Event handler `OnAceptar' not implemented!" 209 event.Skip() 210 211 id_alumno = 1 212 nombre = self.nombres.GetValue() 213 fechanac = self.fechaNac.GetValue() 214 lugarNac = self.lugarNac.GetValue() 215 estcivil = self.estadoCivil.GetValue() 216 domicilio = self.domicilio.GetValue() 217 telefono = self.telefono.GetValue() 218 if self.checkPlan.IsChecked(): 219 plan = 1 220 else: 221 plan = 0 222 planSocial = self.planSocial.GetValue() 223 if self.checkPlanFamiliar.IsChecked(): 224 planFamiliar = 1 225 else: 226 planFamiliar = 0 227 planFamiliar = self.planFamiliar.GetValue() 228 empleo = self.empleo.GetValue() 229 empresa = self.empresa.GetValue() 230 educacion = self.educacion.GetValue() 231 if self.checkAbandono.IsChecked(): 232 abandono = 1 233 else: 234 abandono = 0 235 motivoAbandono = self.motivoAbandono.GetValue() 236 if self.checkCursando.IsChecked(): 237 cursando = 1 238 else: 239 cursando = 0 240 escuelaActual = self.escuelaActual.GetValue() 241 if self.checkFP.IsChecked(): 242 otroscursosfp = 1 243 else: 244 otroscursosfp = 0 245 otroscursosfpcuales = self.cursosFP.GetValue() 246 if self.checkJefeFam.IsChecked(): 247 jefefamilia = 1 248 else: 249 jefefamilia = 0 250 if self.checkDeporte.IsChecked(): 251 deportes = 1 252 else: 253 deportes = 1 254 deportesdonde = self.deportesdonde.GetValue() 255 tiempolibre = self.hobbyes.GetValue() 256 eligioelcentro = self.pQCentro.GetValue() 257 eligioelcurso = self.pQCurso.GetValue() 258 if self.checkJudiciales.IsChecked(): 259 antecedentes = 1 260 else: 261 antecedentes = 0 262 causas = self.judiciales.GetValue() 263 tratmedico = self.tratMed.GetValue() 264 obs = self.obs.GetValue() 265 #c = self.db.cursor() 266 #c.execute('''''') 267 211 268 def OnCancelar(self, event): # wxGlade: LegajoSocial.<event_handler> 212 print "Event handler `OnCancelar' not implemented!" 213 event.Skip() 269 self.Close() 214 270 215 271 # end of class LegajoSocial
Note: See TracChangeset
for help on using the changeset viewer.
