Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9312069
D1861.id6274.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
806 B
Subscribers
None
D1861.id6274.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
@@ -335,6 +335,9 @@
default=None,
validator=attr.validators.optional([]))
+ ctime = attr.ib(type=Optional[datetime.datetime],
+ default=None)
+
@length.validator
def check_length(self, attribute, value):
"""Checks the length is positive."""
@@ -353,8 +356,7 @@
def to_dict(self):
content = attr.asdict(self)
- if content['data'] is None:
- del content['data']
- if content['reason'] is None:
- del content['reason']
+ for field in ('data', 'reason', 'ctime'):
+ if content[field] is None:
+ del content[field]
return content
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 2, 10:41 AM (2 w, 17 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220566
Attached To
D1861: Add optional 'ctime' field to Content.
Event Timeline
Log In to Comment