2016-02-28 22:59:10 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
class SimulationTask(object):
|
|
|
|
'''
|
2016-02-29 02:59:07 +08:00
|
|
|
Encapsulates query data.
|
2016-02-28 22:59:10 +08:00
|
|
|
'''
|
|
|
|
|
|
|
|
def __init__(self, id, query):
|
|
|
|
'''
|
2016-02-29 02:59:07 +08:00
|
|
|
:param id: query id
|
|
|
|
:param query: str, query string
|
2016-02-28 22:59:10 +08:00
|
|
|
'''
|
|
|
|
self.id = id
|
|
|
|
self.query = query
|
2016-03-05 17:10:57 +08:00
|
|
|
|
|
|
|
def json_data(self):
|
|
|
|
'''
|
|
|
|
:returns: dict with all elements
|
|
|
|
'''
|
|
|
|
return {
|
|
|
|
"id": self.id,
|
|
|
|
"query": self.query
|
|
|
|
}
|