(cls, data, collection, sign=True, role_id=None)
| 69 | |
| 70 | @classmethod |
| 71 | def create(cls, data, collection, sign=True, role_id=None): |
| 72 | entity = cls() |
| 73 | entity_id = data.get("id") or make_textid() |
| 74 | if not registry.entity.validate(entity_id): |
| 75 | raise InvalidData(gettext("Invalid entity ID")) |
| 76 | entity.id = collection.ns.sign(entity_id) |
| 77 | entity.collection_id = collection.id |
| 78 | entity.role_id = role_id |
| 79 | entity.update(data, collection, sign=sign) |
| 80 | return entity |
| 81 | |
| 82 | @classmethod |
| 83 | def by_id(cls, entity_id, collection=None): |
nothing calls this directly
no test coverage detected