2011-07-02 5 views
0

これは私が今まで見た中で最も奇妙で非論理的なエラーです。私はジャンゴ+ mongoengineを使用して、そして私の見解であると言うことができています:index.htmlをで記事を奇妙な変わったdjango-mongoengineエラー

def index(request, template_name='index.html'): 

    articles = Article.objects.order_by('-date_added') 

    for i in articles: # test to see if the ordering works 
     print i.title # ok, prints correctly all the titles ordered_by "-date_added" 

    return render_to_response(template_name, locals(), context_instance=RequestContext(request)) 

しかし、ときに私のループ、順序が(「DATE_ADDED」)ORDER_BYたかのように、それらが常に提示されている

私は酔っぱらいますか?何か不足していますか?助言がありますか?これは私を夢中にさせるでしょう...

答えて

0

解決済み:これは実際にはmongoengineのバージョンの問題でした。 mongoengineのdevブランチからインストールしてください。

+0

どのバージョンのバグですか? – dcrosta

+0

現在でも利用可能なものはここにあります。実際にhttps://github.com/hmarr/mongoengine/issues/190という解決策を見つけたのはここです – hymloth