Browse Source

Adding @cached_property to Timestamps

pull/133/head
Justin 6 years ago
committed by GitHub
parent
commit
842308c06e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      disco/types/user.py

2
disco/types/user.py

@ -93,9 +93,11 @@ class Timestamps(SlottedModel):
start = Field(int) start = Field(int)
end = Field(int) end = Field(int)
@cached_property
def start_time(self): def start_time(self):
return datetime.utcfromtimestamp(self.start / 1000) return datetime.utcfromtimestamp(self.start / 1000)
@cached_property
def end_time(self): def end_time(self):
return datetime.utcfromtimestamp(self.end / 1000) return datetime.utcfromtimestamp(self.end / 1000)

Loading…
Cancel
Save