I want to structure a property of an object which should be read from an external system (in this case, it's a blockchain, but could be any other system).
What is the best practice to make the property read-only and have its value taken from the external system? Is the @property pattern usable?
__tablename__ = "example"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
...
@property
def status(self):
...?
Thanks
Adding some details:
- is it ok to use http calls or anyways asynch methods inside the property?
- it would be very nice to save the result of the external call and the time it was taken, something like "latest_checked_state" "latest_check_datetime"