如何在Django中使用mongoengine实现代理模型 作为mysql后端? 例如:
import requests
import requests_toolbelt
auth = requests_toolbelt(username,password)
req = requests.get(url,auth=auth)
代理模型
import datetime
from mongoengine import signals, document, StringField, BooleanField, DictField, DateTimeField, IntField, DynamicDocument, ListField, EmbeddedDocument, EmbeddedDocumentField
class Job(document.Document):
task_id = StringField(null=False)
employees = ListField(field=IntField())
flows = ListField(field=IntField())
execute_time = DateTimeField(default=datetime.datetime.now)
finished_time = DateTimeField()
meta = {
"indexes": [
'task_id',
],
'collection': 'job',
'strict': False,
'auto_create_index': False,
'allow_inheritance': True
}
Job创建的文档,无法通过jobproxy.ojbects进行查询,mongoengine中是否有任何支持的方法?