Skip to content

Commit

Permalink
Merge pull request #115 from EarthSchlange/upgrade_django_tables2.0.0a0
Browse files Browse the repository at this point in the history
Added django_tables2.0.0 with pagination.
  • Loading branch information
Michael Hiiva authored Aug 24, 2020
2 parents eda17ce + 60702e3 commit cf2a340
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion agagd/agagd_core/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from agagd_core.ratings_top_ten_requests import RatingsTopRequest
from datetime import datetime, timedelta, date
from django.core import exceptions
from django.core.paginator import PageNotAnInteger
from django.core.urlresolvers import reverse
from django.db.models import F, Q, Count
from django.http import HttpResponseRedirect
Expand Down Expand Up @@ -69,7 +70,10 @@ def search(request):

member_table = MemberTable(members_query)

RequestConfig(request, paginate={'per_page': 100}).configure(member_table)
try:
RequestConfig(request, paginate={'per_page': 100}).configure(member_table)
except PageNotAnInteger:
RequestConfig(request, paginate=False).configure(member_table)

return render(request, 'agagd_core/search_player.html',
{
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Django==1.11.29
django-admin-tools==0.4.1
django-tables2==1.15.0
django-tables2==2.0.0
PyMySQL==0.10.0
requests==2.22.0
six==1.4.1
Expand Down

0 comments on commit cf2a340

Please sign in to comment.