2016-07-12 2 views
0


mongoengine 모델 데이터를 tastypie로 제공 할 수있는 python-django 라이브러리를 제안 해 주실 수 있습니까? django-tastypie-mongoengine은 더 이상 사용되지 않으며 &은 유지 보수되지 않고 Django 1.9에서 오류가 발생하지만 django 1.8에서는 정상적으로 작동합니다. 다음Django의 몽고 엔진에 대한 Tastypie 1.9+

내 장고 환경 :

  • 장고 1.9.7
  • mongoengine 0.10.6
  • pymongo 3.2.2
  • 장고 - tastypie 0.13.3
  • 장고 - tastypie- 몽고인 0.4.6

다음과 같은 오류가 발생했습니다. 수정 된 내용 :

  1. Initial compile error relating to deprecation of 'SortedDict'.
    Fix: replaced 'SortedDict' with 'OrderedDict' (collections.OrderedDict)
  2. Compile Error: AttributeError: 'StringField' object has no attribute 'help_text' (Line:727)
    Fix: 'help_text': f.help_text -->> 'help_text': getattr(f, 'help_text', ""),
  3. Runtime error: Go to the resource url i.e. /app_name/api/resource_name/?format=json, throws error "TypeError: unsupported operand type(s) for |: 'dict' and 'set'"

나는이 문제를 해결하는 방법에 여전히 혼란 스럽습니다. 오류를 소스로 추적하려고합니다. Django 모델 Tastypie 잘 작동, 유일한 문제는 mongoengine tastypie 함께 장고 1.9 있습니다.

답변

1

django-tastypie-mongoengine에서 django 1.9+와 django-tastypie 0.13.3과 호환되도록 몇 가지 변경을했습니다. github 저장소의 복사본을 포크하고 변경된 내용을 업데이트했습니다. 지금은 잘 작동합니다.

다음은 링크입니다. https://github.com/gagan144/django-tastypie-mongoengine