【问题标题】:Insanely weird django-mongoengine error非常奇怪的 django-mongoengine 错误
【发布时间】:2011-07-02 18:12:17
【问题描述】:

这是我见过的最奇怪和最不合逻辑的错误。我正在使用 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))

但是当我遍历 index.html 中的文章时,它们总是显示为好像排序是 order_by('date_added')

我喝醉了吗?我错过了什么吗?有什么建议么?这会让我发疯...

【问题讨论】:

    标签: django mongoengine


    【解决方案1】:

    已解决:这实际上是 mongoengine 版本的问题。只需从 mongoengine 的 dev 分支安装...

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多