djangosnippets.org: Latest snippets posted by AlecChttps://djangosnippets.org/users/AlecC/2011-11-07T14:56:37.210652-06:00AlecCPaginator for PostgreSQL
2011-11-07T14:56:37.210652-06:00AlecChttps://djangosnippets.org/snippets/2593/<p>Use this paginator to make admin pages load more quickly for large tables when using PostgreSQL. It uses the reltuples statistic instead of counting the rows when there is no where clause. To use this code, add the following in your admin:</p>
<p><code>class BigTableAdmin(admin.ModelAdmin):
paginator = LargeTablePaginator
def get_changelist(self, request, …</code></p>
Freely redistributable