tracking: extend indexdata to include fields that are not part of the metadata
This commit is contained in:
parent
064cac4d53
commit
eb1bd2f169
1 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de
|
||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -68,7 +68,15 @@ class Track(Persistent):
|
|||
def metadata(self):
|
||||
return dict((attr, getattr(self, attr)) for attr in self.metadata_attributes)
|
||||
|
||||
indexdata = metadata
|
||||
@property
|
||||
def indexdata(self):
|
||||
data = {}
|
||||
for attr in self.index_attributes:
|
||||
if attr in self.metadata_attributes:
|
||||
data[attr] = getattr(self, attr)
|
||||
else:
|
||||
data[attr] = self.data[attr]
|
||||
return data
|
||||
|
||||
def __init__(self, taskId, runId, userName, data=None):
|
||||
self.taskId = taskId
|
||||
|
|
Loading…
Add table
Reference in a new issue