asset: sortierung - neueste nach oben, farben - älter als 5 tage = gedimmt
This commit is contained in:
parent
1a61b112e0
commit
d08cf19b60
1 changed files with 6 additions and 3 deletions
5
asset.py
5
asset.py
|
@ -108,14 +108,17 @@ class Asset(ModelSQL, ModelView):
|
|||
def __setup__(cls):
|
||||
super(Asset, cls).__setup__()
|
||||
cls._order.insert(0, ('name', 'ASC'))
|
||||
cls._order.insert(0, ('date', 'DESC'))
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super().view_attributes() + [
|
||||
('/tree', 'visual',
|
||||
If(Eval('date') < Date(delta_days=-5), 'muted',
|
||||
If(Eval('change_day1', 0) < 0, 'warning',
|
||||
If(Eval('change_day1', 0) > 0, 'success', '')
|
||||
)),
|
||||
))
|
||||
),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in a new issue