|
|
|
|
15
|
query = query.select_from(usuarios.join(role, usuarios.columns.id == estudiantes.columns.user_id)).where(estudiantes.columns.user_id == id)
|
15
|
query = query.select_from(usuarios.join(role, usuarios.columns.id == estudiantes.columns.user_id)).where(estudiantes.columns.user_id == id)
|
16
|
result = connection.execute(query).fetchall()
|
16
|
result = connection.execute(query).fetchall()
|
17
|
|
17
|
|
18
|
- return [{"nombres": "Juana", "apellidos":"Del Barrio", "email": "juana1@gmail.com"},{"nombres": "Juana2", "apellidos":"Del Barrio", "email": "juana2@gmail.com"}]
|
|
|
19
|
-
|
|
|
|
|
18
|
+ return result
|
|
|
19
|
+
|
20
|
def list():
|
20
|
def list():
|
21
|
estudiantes = db.Table('estudiantes', metadata, autoload=True, autoload_with=engine))
|
21
|
estudiantes = db.Table('estudiantes', metadata, autoload=True, autoload_with=engine))
|
22
|
usuarios = db.Table('usuarios', metadata, autoload=True, autoload_with=engine)
|
22
|
usuarios = db.Table('usuarios', metadata, autoload=True, autoload_with=engine)
|
|
|
|
|
24
|
query = query.select_from(usuarios.join(role, usuarios.columns.id == estudiantes.columns.user_id)) # .where(role.columns.user_id == self.id)
|
24
|
query = query.select_from(usuarios.join(role, usuarios.columns.id == estudiantes.columns.user_id)) # .where(role.columns.user_id == self.id)
|
25
|
result = connection.execute(query).fetchall()
|
25
|
result = connection.execute(query).fetchall()
|
26
|
|
26
|
|
27
|
- return [{"nombres": "Juana", "apellidos":"Del Barrio", "email": "juana1@gmail.com"},{"nombres": "Juana2", "apellidos":"Del Barrio", "email": "juana2@gmail.com"}]
|
|
|
28
|
-
|
|
|
|
|
27
|
+ return result
|
29
|
|
28
|
|
30
|
|
29
|
|
31
|
def main()
|
30
|
def main()
|