Exemplo n.º 1
0
	def check(self, tipo=None, nro_control=None, titulo=None, id_msj=None):
		with _db_session:
			if nro_control:
				return _select(msg for msg in _Mensaje if int(nro_control)==msg.nro_control and int(tipo)==msg.tipo and msg.activo==True).exists()
			else:
				if id_msj:
					tmp = _Mensaje.select(lambda msg: id_msj!=msg.id_msj and msg.titulo==titulo and msg.activo==True).count()
					return False if tmp==0 else True
				else:
					return _select(msg for msg in _Mensaje if titulo==msg.titulo and int(tipo)==msg.tipo and msg.activo==True).exists()
Exemplo n.º 2
0
	def v_ci(self, ci):
		try:
			with _db_session:
				return _select(pr for pr in _Persona if pr.ci==ci).exists()
		except Exception, e:
			#raise e
			return False
Exemplo n.º 3
0
	def v_telf(self, telf):
		try:
			with _db_session:
				return _select(pr for pr in _Persona if pr.telf==telf).exists()
		except Exception, e:
			#raise e
			return False
Exemplo n.º 4
0
	def v_login(self, login):
		try:
			with _db_session:
				return _select(us for us in _Usuario if us.login==login).exists()
		except Exception, e:
			print e
			return False
Exemplo n.º 5
0
 def v_login(self, login):
     try:
         with _db_session:
             return _select(us for us in _Usuario
                            if us.login == login).exists()
     except Exception, e:
         print e
         return False
Exemplo n.º 6
0
	def get_All(cls):
		return _select(tn for tn in _Comunidad)
Exemplo n.º 7
0
	def getbyChild(cls, id_rcn):
		return _select(ct for ct in _Control if ct.recien_nacido.id_rcn==id_rcn).order_by(lambda ct: (ct.nro_con, ct.fecha_con))
Exemplo n.º 8
0
	def getbyPregnancy(cls, id_emb):
		return _select(ct for ct in _Control if ct.embarazo.id_emb==id_emb).order_by(lambda ct: (ct.nro_con, ct.fecha_con))
Exemplo n.º 9
0
	def get_All(self, status=True):
		return _select(pr for pr in _Persona if pr.activo==status and not pr.defuncion).order_by(lambda pr: (pr.nombres, pr.apellidos))
Exemplo n.º 10
0
	def get_All(self):
		return _select(cm for cm in _Comunidad).order_by(lambda cm: (cm.municipio, cm.nombre))
Exemplo n.º 11
0
 def get_All(self):
     return _select(cm for cm in _Comunidad).order_by(
         lambda cm: (cm.municipio, cm.nombre))
Exemplo n.º 12
0
	def get_all(self, id_per):
		return _select(em for em in _Embarazo if em.embarazada.id_per==id_per).order_by(lambda em: (_desc(em.parto_prob),))
Exemplo n.º 13
0
	def get_All(cls):
		# return _select(tn for tn in _Comunidad)
		return _select(tn for tn in _Municipio).order_by(lambda tn: (tn.dpto, tn.nombre))
Exemplo n.º 14
0
	def prenants_by_community(self, id_com):
		return _select(pr for pr in _Per if pr.sexo=='f' and pr.comunidad.id_com==id_com)
Exemplo n.º 15
0
 def get_All(cls):
     return _select(nt
                    for nt in _Red_Salud).order_by(lambda nt: (nt.nombre, ))
Exemplo n.º 16
0
	def get_All(cls):
		return _select(nt for nt in _Red_Salud).order_by(lambda nt: (nt.nombre,))