Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Gabriel Weisse
/
presupuestov1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
pr0nstar
2026-04-21 15:23:00 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
88f66b0bd7d083fe5ab3c07e547b88a891962a1e
88f66b0b
1 parent
0a00bab6
XVI.II
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
main.py
routers/project.py
schema.py
main.py
View file @
88f66b0
...
...
@@ -40,14 +40,14 @@ app = FastAPI(
CacheMiddleware
,
cache
=
cache
.
cache
,
rules
=
[
Rule
(
match
=
re
.
compile
(
r"^/prespuesto/api/_metrics/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r"^/prespuesto/api/search/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r"^/prespuesto/api/programa_proyecto/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r'^/prespuesto/api/.+'
),
ttl
=
86400
,
status
=
200
),
Rule
(
match
=
re
.
compile
(
r"^/pres
u
puesto/api/_metrics/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r"^/pres
u
puesto/api/search/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r"^/pres
u
puesto/api/programa_proyecto/.*"
),
ttl
=
0
),
Rule
(
match
=
re
.
compile
(
r'^/pres
u
puesto/api/.+'
),
ttl
=
86400
,
status
=
200
),
],
),
],
root_path
=
'/prespuesto/api'
root_path
=
'/pres
u
puesto/api'
)
app
.
include_router
(
entity
.
router_entidad
)
...
...
routers/project.py
View file @
88f66b0
...
...
@@ -73,7 +73,7 @@ def fetch_programa_proyecto_proyectos(
@router.get
(
'/{project_id}/objetos'
,
response_model
=
List
[
schemas
.
project
.
ProyectoClasificadores
])
def
fetch_programa_proyecto_objetos
(
project_id
:
int
,
project_id
:
str
,
db
:
Session
=
Depends
(
model
.
get_db
),
query
:
schema
.
QueryParamsPaginated
=
Depends
(),
):
...
...
@@ -82,7 +82,7 @@ def fetch_programa_proyecto_objetos(
@router.get
(
'/{project_id}/finfuns'
,
response_model
=
List
[
schemas
.
project
.
ProyectoClasificadores
])
def
fetch_programa_proyecto_finfuns
(
project_id
:
int
,
project_id
:
str
,
db
:
Session
=
Depends
(
model
.
get_db
),
query
:
schema
.
QueryParamsPaginated
=
Depends
(),
):
...
...
@@ -91,7 +91,7 @@ def fetch_programa_proyecto_finfuns(
@router.get
(
'/{project_id}/actecos'
,
response_model
=
List
[
schemas
.
project
.
ProyectoClasificadores
])
def
fetch_programa_proyecto_actecos
(
project_id
:
int
,
project_id
:
str
,
db
:
Session
=
Depends
(
model
.
get_db
),
query
:
schema
.
QueryParamsPaginated
=
Depends
(),
):
...
...
@@ -120,6 +120,8 @@ def get_clasificadores(db, tipo_codigo, programa_proyecto, query):
if
query
.
gestion
is
not
None
:
filters
.
append
(
ProyectoClasificadores
.
gestion
==
query
.
gestion
)
return
select
(
*
cols
)
.
where
(
*
filters
)
.
offset
(
(
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
.
mappings
()
.
all
()
return
db
.
execute
(
select
(
*
cols
)
.
where
(
*
filters
)
.
offset
(
(
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
)
.
mappings
()
.
all
()
...
...
schema.py
View file @
88f66b0
...
...
@@ -15,6 +15,7 @@ class SearchQueryParams(BaseModel):
is_class
:
Optional
[
bool
]
=
Query
(
default
=
None
)
class_
:
Optional
[
str
]
=
Query
(
default
=
None
)
class
QueryParams
(
BaseModel
):
id
:
Optional
[
str
]
=
Query
(
default
=
None
)
gestion
:
Optional
[
int
]
=
Query
(
default
=
None
)
...
...
@@ -22,7 +23,8 @@ class QueryParams(BaseModel):
class
QueryParamsPaginated
(
QueryParams
):
page
:
Optiona
[
int
]
=
Query
(
default
=
None
)
page
:
Optional
[
int
]
=
Query
(
default
=
None
)
class
DailyParams
(
BaseModel
):
transferencias
:
Optional
[
bool
]
=
Query
(
default
=
False
)
...
...
Please
register
or
login
to post a comment