speedup: indexes, caching
This commit is contained in:
parent
86e6c33cc1
commit
624a5bff55
11 changed files with 352 additions and 32 deletions
16
mixin.py
16
mixin.py
|
@ -10,6 +10,7 @@ from trytond.modules.currency.ir import rate_decimal
|
|||
from trytond.transaction import Transaction
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
STATES = {
|
||||
'readonly': Or(
|
||||
Eval('state', '') != 'edit',
|
||||
|
@ -187,3 +188,18 @@ class SecondCurrencyMixin:
|
|||
return 2
|
||||
|
||||
# end SecondCurrencyMixin
|
||||
|
||||
|
||||
class MemCacheIndexMx:
|
||||
""" add index to 'create_date' + 'write_date'
|
||||
"""
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(MemCacheIndexMx, cls).__setup__()
|
||||
# add index
|
||||
cls.write_date.select = True
|
||||
cls.create_date.select = True
|
||||
|
||||
# end MemCacheIndexMx
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue