Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.cuhk_cufs
Commits
be1360b9
Commit
be1360b9
authored
Aug 24, 2015
by
Tiago de Freitas Pereira
Browse files
Fixed bugs
parent
f3b770c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/db/cuhk_cufs/query.py
View file @
be1360b9
...
...
@@ -125,10 +125,17 @@ class Database(bob.db.verification.utils.SQLiteDatabase, bob.db.verification.uti
query
=
query
.
filter
(
bob
.
db
.
cuhk_cufs
.
Protocol_File_Association
.
purpose
.
in_
(
purposes
))
if
model_ids
is
not
None
:
if
type
(
model_ids
)
is
not
list
and
type
(
model_ids
)
is
not
tuple
:
model_ids
=
[
model_ids
]
query
=
query
.
filter
(
bob
.
db
.
cuhk_cufs
.
Client
.
id
.
in_
(
model_ids
))
if
type
(
model_ids
)
is
not
list
and
type
(
model_ids
)
is
not
tuple
:
model_ids
=
[
model_ids
]
#if you provide a client object as input and not the ids
if
type
(
model_ids
[
0
])
is
bob
.
db
.
cuhk_cufs
.
Client
:
model_aux
=
[]
for
m
in
model_ids
:
model_aux
.
append
(
m
.
id
)
model_ids
=
model_aux
query
=
query
.
filter
(
bob
.
db
.
cuhk_cufs
.
Client
.
id
.
in_
(
model_ids
))
raw_files
=
query
.
all
()
files
=
[]
...
...
@@ -158,7 +165,7 @@ class Database(bob.db.verification.utils.SQLiteDatabase, bob.db.verification.uti
query
=
query
.
filter
(
bob
.
db
.
cuhk_cufs
.
Protocol_File_Association
.
group
.
in_
(
groups
))
query
=
query
.
filter
(
bob
.
db
.
cuhk_cufs
.
Protocol_File_Association
.
protocol
.
in_
(
protocols
))
return
query
.
all
()
return
[
c
.
id
for
c
in
query
.
all
()
]
def
groups
(
self
,
protocol
=
None
,
**
kwargs
):
...
...
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