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
9
asset.py
9
asset.py
|
@ -108,14 +108,17 @@ class Asset(ModelSQL, ModelView):
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(Asset, cls).__setup__()
|
super(Asset, cls).__setup__()
|
||||||
cls._order.insert(0, ('name', 'ASC'))
|
cls._order.insert(0, ('name', 'ASC'))
|
||||||
|
cls._order.insert(0, ('date', 'DESC'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def view_attributes(cls):
|
def view_attributes(cls):
|
||||||
return super().view_attributes() + [
|
return super().view_attributes() + [
|
||||||
('/tree', 'visual',
|
('/tree', 'visual',
|
||||||
If(Eval('change_day1', 0) < 0, 'warning',
|
If(Eval('date') < Date(delta_days=-5), 'muted',
|
||||||
If(Eval('change_day1', 0) > 0, 'success', '')
|
If(Eval('change_day1', 0) < 0, 'warning',
|
||||||
)),
|
If(Eval('change_day1', 0) > 0, 'success', '')
|
||||||
|
))
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue