db.define_table('lineas',
Field('Cod_Linea', type='integer', label=T('Código Línea')),
Field('Nom_Linea', type='string' , label=T('Nombre de Línea')),
migrate=True)
db.lineas.insert(Cod_Linea = 1, Nom_Linea = 'Linea 001')
db.lineas.insert(Cod_Linea = 2, Nom_Linea = 'Linea 002')
db.lineas.insert(Cod_Linea = 3, Nom_Linea = 'Linea 003')
db.lineas.insert(Cod_Linea = 4, Nom_Linea = 'Linea 004')
def lineassql():
conjunto = set()
conjunto.add(1)
conjunto.add(3)
registros = db(db.lineas.Cod_Linea in conjunto).select(db.lineas.ALL)
db.auth_user.first_name(("Martin", "Juan", "Pepe"))
Accepts the following inputs:
field.belongs(1,2)
field.belongs((1,2))
field.belongs(query)
Does NOT accept:
field.belongs(1)
def lineassql():
conjunto = set()
conjunto.add(1)
conjunto.add(3)
registros = db(db.lineas.Cod_Linea.belongs(list(conjunto))).select(db.lineas.ALL)