DjangoのREST APIにtastypie_mongoengine
を使用しています。'module'オブジェクトに 'SortedDict'属性がありませんDjango Tastypieエラー
models.py
import mongoengine
import datetime
class Students(mongoengine.Document):
name = mongoengine.StringField(required=True)
age = mongoengine.StringField(required=True)
student_class = mongoengine.StringField(required=True)`
私は、次のエラーを取得しています
from tastypie import authorization
from tastypie_mongoengine import resources
from models import Students
class StudentsResource(resources.MongoEngineResource):
class Meta:
queryset = Students.objects.all()
allowed_methods = ('get', 'post', 'put','delete', 'patch')
authorization = authorization.Authorization()
api.py:
File "/home/my_name/projects/StudentBehaviour/mysite/mysite/urls.py", line 3, in <module>
from app.api import StudentsResource
File "/home/my_name/projects/StudentBehaviour/mysite/app/api.py", line 3, in <module>
from tastypie_mongoengine import resources
File "/home/my_name/projects/StudentBehaviour/env/local/lib/python2.7/site-packages/tastypie_mongoengine/resources.py", line 54, in <module>
class ListQuerySet(datastructures.SortedDict):
AttributeError: 'module' object has no attribute 'SortedDict'
どのように私はこの問題を解決するのですか?
使用しているDjangoのバージョンは? – JRodDynamite
Django == 1.9.4 django-tastypie == 0.13.3 django-tastypie-mongoengine == 0.4.6 mongoengine == 0.8.1 – user3787291