|
a/Allura/allura/model/monq_model.py |
|
b/Allura/allura/model/monq_model.py |
|
... |
|
... |
8 |
from pylons import c, g
|
8 |
from pylons import c, g
|
9 |
|
9 |
|
10 |
import ming
|
10 |
import ming
|
11 |
from ming.utils import LazyProperty
|
11 |
from ming.utils import LazyProperty
|
12 |
from ming import schema as S
|
12 |
from ming import schema as S
|
13 |
from ming.orm import session, MappedClass, FieldProperty
|
13 |
from ming.orm import session, FieldProperty
|
|
|
14 |
from ming.orm.declarative import MappedClass
|
14 |
|
15 |
|
15 |
from .session import main_orm_session
|
16 |
from .session import main_orm_session
|
16 |
|
17 |
|
17 |
log = logging.getLogger(__name__)
|
18 |
log = logging.getLogger(__name__)
|
18 |
|
19 |
|
|
... |
|
... |
40 |
result_types = ('keep', 'forget')
|
41 |
result_types = ('keep', 'forget')
|
41 |
class __mongometa__:
|
42 |
class __mongometa__:
|
42 |
session = main_orm_session
|
43 |
session = main_orm_session
|
43 |
name = 'monq_task'
|
44 |
name = 'monq_task'
|
44 |
indexes = [
|
45 |
indexes = [
|
|
|
46 |
[
|
45 |
[ ('state', ming.ASCENDING),
|
47 |
('state', ming.ASCENDING),
|
46 |
('priority', ming.DESCENDING),
|
48 |
('priority', ming.DESCENDING),
|
47 |
('time_queue', ming.ASCENDING) ],
|
49 |
('time_queue', ming.ASCENDING)
|
|
|
50 |
],
|
|
|
51 |
[
|
|
|
52 |
'state',
|
48 |
['state', 'time_queue'],
|
53 |
'time_queue'
|
|
|
54 |
],
|
49 |
]
|
55 |
]
|
50 |
|
56 |
|
51 |
_id = FieldProperty(S.ObjectId)
|
57 |
_id = FieldProperty(S.ObjectId)
|
52 |
state = FieldProperty(S.OneOf(*states))
|
58 |
state = FieldProperty(S.OneOf(*states))
|
53 |
priority = FieldProperty(int)
|
59 |
priority = FieldProperty(int)
|
54 |
result_type = FieldProperty(S.OneOf(*result_types))
|
60 |
result_type = FieldProperty(S.OneOf(*result_types))
|