コード例 #1
0
ファイル: records.py プロジェクト: clohr/model-service
def create_relationship(
    db: PartitionedDatabase, record_id: RecordId, body: JsonDict
) -> Tuple[JsonDict, int]:
    (relationship, _) = db.create_record_relationship(
        from_record=record_id, relationship=body["type_"], to_record=body["to"]
    )
    return relationship.to_dict(), 201
コード例 #2
0
def create_linked_property(db: PartitionedDatabase, concept_id: str,
                           id_: RecordId, body: JsonDict):
    (rr, _) = db.create_record_relationship(
        from_record=id_,
        relationship=body["schema_linked_property_id"],
        to_record=body["to"],
    )
    return to_linked_property(rr), 201