Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9341774
D7536.id27326.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
772 B
Subscribers
None
D7536.id27326.diff
View Options
diff --git a/swh/model/model.py b/swh/model/model.py
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -1513,3 +1513,28 @@
def _compute_hash_from_attributes(self) -> bytes:
return _compute_hash_from_manifest(git_objects.extid_git_object(self))
+
+
+SWH_MODEL_OBJECT_TYPES = {
+ cls.object_type: cls # type: ignore
+ for cls in (
+ Person,
+ Timestamp,
+ TimestampWithTimezone,
+ Origin,
+ OriginVisit,
+ OriginVisitStatus,
+ Snapshot,
+ SnapshotBranch,
+ Release,
+ Revision,
+ Directory,
+ DirectoryEntry,
+ Content,
+ SkippedContent,
+ MetadataAuthority,
+ MetadataFetcher,
+ RawExtrinsicMetadata,
+ ExtID,
+ )
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 12:18 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3232379
Attached To
D7536: Add a SWH_MODEL_OBJECT_TYPES map {cls.objet_type: cls} in model.py
Event Timeline
Log In to Comment