##// END OF EJS Templates
artifacts: added __json__ method to be used in artifacts API
marcink -
r3999:94391e06 default
parent child Browse files
Show More
@@ -5224,6 +5224,23 b' class FileStore(Base, BaseModel):'
5224 5224 if commit:
5225 5225 Session().commit()
5226 5226
5227 def __json__(self):
5228 data = {
5229 'filename': self.file_display_name,
5230 'filename_org': self.file_org_name,
5231 'file_uid': self.file_uid,
5232 'description': self.file_description,
5233 'hidden': self.hidden,
5234 'size': self.file_size,
5235 'created_on': self.created_on,
5236 'uploaded_by': self.upload_user.get_api_data(details='basic'),
5237 'downloaded_times': self.accessed_count,
5238 'sha256': self.file_hash,
5239 'metadata': self.file_metadata,
5240 }
5241
5242 return data
5243
5227 5244 def __repr__(self):
5228 5245 return '<FileStore({})>'.format(self.file_store_id)
5229 5246
General Comments 0
You need to be logged in to leave comments. Login now