2010-01-22 34 views
0

我正在使用Django開發Google App Engine項目。我注意到,出於某種原因,Django管理系統頁面僅列出了一個模型的301個實體,另一個模型僅列出了301個實體。但實際上這兩種模型都有超過500個存儲實例。什麼可能導致這個問題?爲什麼Django管理站點限制爲301條目?

回答

0

實際上,它看起來像是硬編碼到較舊版本的App Engine Patch中的限制。

從patch.py​​:

def patch_app_engine(): 
    # This allows for using Paginator on a Query object. We limit the number 
    # of results to 301, so there won't be any timeouts (301, so you can say 
    # "more than 300 results"). 
    def __len__(self): 
     return self.count() 
    db.Query.__len__ = __len__ 

    old_count = db.Query.count 
    def count(self, limit=301): 
     return old_count(self, limit) 
    db.Query.count = count 
0

也許下面的SO問題是關於:Django admin does not show all entities

的問題可能是一些ForeignKey是你要在管理點列出在數據庫中不存在的對象模型的實例。

請檢查模型的所有ForeignKey值是否設置正確。