Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
JMMC
jmmc-jmdcui-docker
Commits
68fc5e3c
Commit
68fc5e3c
authored
Jan 17, 2020
by
Guillaume Mella
Browse files
improve reliability so we always give validated stars to jinja
parent
4ed95c81
Changes
1
Hide whitespace changes
Inline
Side-by-side
jmdc-ui/jmdc_app/views/jmdc_catalog.py
View file @
68fc5e3c
#from pyramid.response import Response
from
pyramid.view
import
view_config
#from sqlalchemy.exc import DBAPIError
from
jmdc_app.models.star_info
import
StarInfo
from
jmdc_app.models.submission
import
StarInfoEntry
@
view_config
(
route_name
=
'jmdc_catalog'
,
renderer
=
'../templates/jmdc_catalog.jinja2'
)
def
jmdc_home
(
request
):
session
=
request
.
dbsession
# order by id (creation order / look during import )
stars
=
session
.
query
(
StarInfo
).
order_by
(
StarInfo
.
id
).
all
()
stars
=
session
.
query
(
StarInfo
).
filter
(
StarInfo
.
star_info_entry
.
any
(
StarInfoEntry
.
validated
==
True
)).
order_by
(
StarInfo
.
id
).
all
()
return
{
'stars'
:
stars
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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