views:

65

answers:

2

I'm working on a Google App Engine project using Django. I noticed that for some reason, the Django administration system page lists only 301 entities for one model, and 301 entities for another model. But there are actually over 500 stored instances for both of these models. What could be causing this problem?

A: 

Maybe the following SO question is related: http://stackoverflow.com/questions/2085593/django-admin-does-not-show-all-entities

The problem could be that some ForeignKeys of instances of the model you want to list in the admin points to objects in the database that don't exist.

Please check that all ForeignKey values of the model are set correctly.

Gregor Müllegger
A: 

Actually, it looks like this is a limit hardcoded into an older version of App Engine Patch.

from 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
amdfan