Commit accd7901 authored by André Anjos's avatar André Anjos 💬

Fixes to model.id -> model.name as model identifier

parent 966e487b
Pipeline #13981 passed with stages
in 7 minutes and 59 seconds
......@@ -110,7 +110,7 @@ class Interface(BaseInterface):
parser.add_argument('-e', '--extension', default='', help="if given, this extension will be appended to every entry returned.")
parser.add_argument('-p', '--protocol', help="if given, limits the dump to a particular subset of the data that corresponds to the given protocol.", choices=db.protocol_names() if db.is_valid() else ())
parser.add_argument('-u', '--purpose', help="if given, this value will limit the output files to those designed for the given purposes.", choices=db.purposes() if db.is_valid() else ())
parser.add_argument('-m', '--models', type=int, help="if given, limits the dump to a particular model")
parser.add_argument('-m', '--models', type=str, help="if given, limits the dump to a particular model")
parser.add_argument('-g', '--group', help="if given, this value will limit the output files to those belonging to a particular protocolar group.", choices=db.groups() if db.is_valid() else ())
parser.add_argument('-c', '--class', dest='sclass', help="if given, this value will limit the output files to those belonging to the given classes.", choices=('client', 'impostor'))
parser.add_argument('--self-test', dest="selftest", action='store_true', help=argparse.SUPPRESS)
......
......@@ -73,7 +73,7 @@ class Database(bob.db.base.SQLiteDatabase):
def finger_name_from_model_id(self, model_id):
"""Returns the unique finger name in the database given a ``model_id``"""
model = self.query(Model).filter(Model.id==model_id).one()
model = self.query(Model).filter(Model.name==model_id).first()
return model.finger.unique_name
......@@ -242,7 +242,7 @@ class Database(bob.db.base.SQLiteDatabase):
q = self.query(File).join(Model.files)
q = q.join(Finger).join(Client)
q = q.filter(Model.group.in_(groups))
if model_ids: q = q.filter(Model.id.in_(model_ids))
if model_ids: q = q.filter(Model.name.in_(model_ids))
q = q.filter(Model.protocol_id.in_(protocol_ids))
q = q.filter(Client.gender.in_(genders))
q = q.filter(Finger.side.in_(sides))
......
......@@ -236,10 +236,10 @@ def test_driver_api():
from bob.db.base.script.dbmanage import main
nose.tools.eq_(main('fv3d dumplist --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=left --group=dev --purpose=enroll --model=2401 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=central --group=dev --purpose=enroll --model=1 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=right --group=dev --purpose=enroll --model=3601 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=stitched --group=dev --purpose=enroll --model=1201 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=left --group=dev --purpose=enroll --model=110-rm-12 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=central --group=dev --purpose=enroll --model=101-lm-12 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=right --group=dev --purpose=enroll --model=149-lr-21 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d dumplist --protocol=stitched --group=dev --purpose=enroll --model=153-rr-22 --self-test'.split()), 0)
nose.tools.eq_(main('fv3d checkfiles --self-test'.split()), 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment