(session: Session, project_id: int)
| 42 | return result |
| 43 | |
| 44 | def get_default(session: Session, project_id: int): |
| 45 | |
| 46 | schema = session.query(LabelSchema).filter( |
| 47 | LabelSchema.project_id == project_id, |
| 48 | LabelSchema.name == 'Default Schema' |
| 49 | ).first() |
| 50 | if schema is None: |
| 51 | schema = session.query(LabelSchema).filter( |
| 52 | LabelSchema.project_id == project_id, |
| 53 | LabelSchema.is_default == True |
| 54 | ).first() |
| 55 | if schema is None: |
| 56 | schema = session.query(LabelSchema).filter( |
| 57 | LabelSchema.project_id == project_id).first() |
| 58 | return schema |
| 59 | |
| 60 | @staticmethod |
| 61 | def new(session: Session, |
no outgoing calls
no test coverage detected