summaryrefslogtreecommitdiff
path: root/app/sightings
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-02-06 10:36:26 -0600
committerluxagraf <sng@luxagraf.net>2018-02-06 10:36:26 -0600
commit58473dd4e0758894f15f834bddedd0caf11cfa59 (patch)
tree6f4d4fb9e120813bcbaaf03044fdb84eb7764c41 /app/sightings
parentadcd4671a261aa72d459b691aabb6f2eef2a0cb7 (diff)
converted to new path url structure and updated pagination to handle it.
Diffstat (limited to 'app/sightings')
-rw-r--r--app/sightings/migrations/0002_auto_20180205_1430.py27
-rw-r--r--app/sightings/urls.py6
2 files changed, 30 insertions, 3 deletions
diff --git a/app/sightings/migrations/0002_auto_20180205_1430.py b/app/sightings/migrations/0002_auto_20180205_1430.py
new file mode 100644
index 0000000..e917508
--- /dev/null
+++ b/app/sightings/migrations/0002_auto_20180205_1430.py
@@ -0,0 +1,27 @@
+# Generated by Django 2.0.1 on 2018-02-05 14:30
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sightings', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='sighting',
+ options={'get_latest_by': 'pub_date', 'ordering': ['-pub_date']},
+ ),
+ migrations.RenameField(
+ model_name='sighting',
+ old_name='date',
+ new_name='pub_date',
+ ),
+ migrations.AlterField(
+ model_name='apclass',
+ name='kind',
+ field=models.IntegerField(choices=[(1, 'Birds'), (2, 'Mammals'), (3, 'Reptiles'), (4, 'Amphibians'), (5, 'Plants')], default=1),
+ ),
+ ]
diff --git a/app/sightings/urls.py b/app/sightings/urls.py
index 51b29d7..f60be22 100644
--- a/app/sightings/urls.py
+++ b/app/sightings/urls.py
@@ -1,4 +1,4 @@
-from django.urls import path
+from django.urls import path, re_path
from . import views
app_name = "sightings"
@@ -10,8 +10,8 @@ urlpatterns = [
{'page':1},
name="list"
),
- path(
- r'<int:page>/',
+ re_path(
+ r'(?P<page>\d+)/$',
views.SightingListView.as_view(),
name="list"
),