我想切換到Django使用MongoDB,但遇到了問題。也就是說,站點的某些部分在/ admin/myApp/myModel處給出'DatabaseError:數據庫不支持該查詢。'正如類似的問題描述貼here,從... /管理/模板/ change_list.html,並拋出它的行此錯誤棱是行85:Django MongoDB DatabaseError at/admin
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
我有好幾個型號,含有多種CharFields,IntegerFields,BooleanFields,DateFields,URLFields和DecimalFields。還有一個ManyToManyField:
class Trail(models.Model):
sections = models.ManyToManyField(TrailSection)
我曾與用戶等沒有問題,但每當我嘗試訪問足跡模型,我得到上述錯誤。當我點擊/ admin頁面的TrailSection部分時,沒有任何問題,但是當我點擊Trail時會出現這個錯誤。它是確定調用
associatedTrails = Trail.objects.filter(sections=sect).order_by('-date').values('trail_id','name')
,但我得到的錯誤,當我後來用
for t in associatedTrails:
在計算器上的其他問題文檔此錯誤是需要被修正了一個錯誤,但我的問題是這樣的:爲什麼有時只發生這種情況?爲什麼TrailSections或其他/ admin頁面沒有問題,但是這會引發錯誤?有沒有一種好方法來修復它?