djangogoogle-app-engineapp-engine-patch

Why would a Django admin site limited to 301 entries?


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?


Solution

  • 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