Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nodo_medicina_3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hector Mauricio Salazar Ledesma
nodo_medicina_3
Commits
06298557
Commit
06298557
authored
Mar 21, 2022
by
Hector Mauricio Salazar Ledesma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregue nuevas queries, como consultar datos por sexo y por id
parent
3921d99d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
nodo/__pycache__/schema.cpython-36.pyc
+0
-0
nodo/schema.py
+15
-5
No files found.
nodo/__pycache__/schema.cpython-36.pyc
View file @
06298557
No preview for this file type
nodo/schema.py
View file @
06298557
import
graphene
from
graphene_django
import
DjangoObjectType
from
graphene_django
import
Django
ListField
,
Django
ObjectType
from
.models
import
Datos_personales
,
Estudios
,
Antecedentes
,
Autoevaluacion_salud
,
Percepcion
,
Personalidad
,
Estatus_economico
,
Nutricion
,
Actividad_fisica
,
Informacion_salud
,
Observaciones
,
Antropometria
,
Laboratorio
,
Bioimpedancia
...
...
@@ -117,7 +117,10 @@ class BioimpedanciaType(DjangoObjectType):
class
Query
(
graphene
.
ObjectType
):
all_datos
=
graphene
.
List
(
Datos_personalesType
)
all_estudios
=
graphene
.
List
(
EstudiosType
)
datos
=
graphene
.
Field
(
Datos_personalesType
,
id
=
graphene
.
Int
())
filter_sexo
=
graphene
.
List
(
Datos_personalesType
,
sex
=
graphene
.
String
())
all_estudios
=
graphene
.
Field
(
EstudiosType
,
id
=
graphene
.
Int
())
all_antecedentes
=
graphene
.
List
(
AntecedentesType
)
all_autoevaluacion
=
graphene
.
List
(
Autoevaluacion_saludType
)
all_percepcion
=
graphene
.
List
(
PercepcionType
)
...
...
@@ -131,11 +134,18 @@ class Query(graphene.ObjectType):
all_laboratorio
=
graphene
.
List
(
LaboratorioType
)
all_bioimpedancia
=
graphene
.
List
(
BioimpedanciaType
)
#Queries para Datos_personales
def
resolve_all_datos
(
root
,
info
):
return
Datos_personales
.
objects
.
all
()
def
resolve_all_estudios
(
root
,
info
):
return
Estudios
.
objects
.
all
()
def
resolve_datos
(
root
,
info
,
id
):
return
Datos_personales
.
objects
.
get
(
pk
=
id
)
def
resolve_filter_sexo
(
root
,
info
,
sex
):
return
Datos_personales
.
objects
.
filter
(
sexo
=
sex
)
#Queries para Estudios
def
resolve_all_estudios
(
root
,
info
,
id
):
return
Estudios
.
objects
.
get
(
pk
=
id
)
def
resolve_all_antecedentes
(
root
,
info
):
return
Antecedentes
.
objects
.
all
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment