tkp.db.quality – Routines handling the ‘rejectreason’ table.

check image quality

tkp.db.quality.isrejected(imageid, session)[source]

Find out if an image is rejected or not :param imageid: The image ID :param session: Database session. :type session: sqlalchemy.orm.Session

Returns:
Empty if not rejected, a list of strings formatted as
‘{description}: {comment}’ if rejected.
Return type:list
tkp.db.quality.reject(imageid, reason, comment, session)[source]

Add a reject reason to the db for a given image.

Parameters:
  • imageid (int) – The image ID of the image to reject
  • reason (tkp.db.model.Rejectreason) – Why is the image rejected
  • comment (str) – An optional comment with details about the reason
  • session (sqlalchemy.orm.Session) – Database session.
tkp.db.quality.sync_rejectreasons(session)[source]

Check if rejectreasons are in sync. If not, insert as needed and commit.

Parameters:session (sqlalchemy.orm.Session) – Database session.
tkp.db.quality.unreject(imageid, session)[source]

Remove any rejections of a given imageid

Parameters:
  • imageid – The image ID
  • session (sqlalchemy.orm.Session) – Database session.