diff --git a/core/models.py b/core/models.py index b817a947..5ba9d66c 100644 --- a/core/models.py +++ b/core/models.py @@ -5,7 +5,7 @@ from django.conf import settings from django.core.cache import cache from django.core.exceptions import ValidationError from django.db import models -from django.template.defaultfilters import slugify +from django.utils.text import slugify from django.utils import timezone from django.utils.text import format_lazy from django.utils.translation import gettext_lazy as _ @@ -80,6 +80,7 @@ class Child(models.Model): verbose_name=_('Birth date') ) slug = models.SlugField( + allow_unicode=True, blank=False, editable=False, max_length=100, @@ -107,7 +108,7 @@ class Child(models.Model): return '{} {}'.format(self.first_name, self.last_name) def save(self, *args, **kwargs): - self.slug = slugify(self) + self.slug = slugify(self, allow_unicode=True) super(Child, self).save(*args, **kwargs) cache.set(self.cache_key_count, Child.objects.count(), None) diff --git a/core/urls.py b/core/urls.py index a8790b64..7c03e44f 100644 --- a/core/urls.py +++ b/core/urls.py @@ -8,14 +8,14 @@ app_name = 'core' urlpatterns = [ path('children/', views.ChildList.as_view(), name='child-list'), path('children/add/', views.ChildAdd.as_view(), name='child-add'), - path('children//', views.ChildDetail.as_view(), name='child'), + path('children//', views.ChildDetail.as_view(), name='child'), path( - 'children//edit/', + 'children//edit/', views.ChildUpdate.as_view(), name='child-update' ), path( - 'children//delete/', + 'children//delete/', views.ChildDelete.as_view(), name='child-delete' ), diff --git a/dashboard/urls.py b/dashboard/urls.py index 75b63291..4057d8c1 100644 --- a/dashboard/urls.py +++ b/dashboard/urls.py @@ -8,7 +8,7 @@ app_name = 'dashboard' urlpatterns = [ path('dashboard/', views.Dashboard.as_view(), name='dashboard'), path( - 'children//dashboard/', + 'children//dashboard/', views.ChildDashboard.as_view(), name='dashboard-child' ), diff --git a/reports/urls.py b/reports/urls.py index c5e4e2dc..30cb6947 100644 --- a/reports/urls.py +++ b/reports/urls.py @@ -7,42 +7,42 @@ app_name = 'reports' urlpatterns = [ path( - 'children//reports/changes/amounts/', + 'children//reports/changes/amounts/', views.DiaperChangeAmounts.as_view(), name='report-diaperchange-amounts-child' ), path( - 'children//reports/changes/lifetimes/', + 'children//reports/changes/lifetimes/', views.DiaperChangeLifetimesChildReport.as_view(), name='report-diaperchange-lifetimes-child' ), path( - 'children//reports/changes/types/', + 'children//reports/changes/types/', views.DiaperChangeTypesChildReport.as_view(), name='report-diaperchange-types-child' ), path( - 'children//reports/feeding/amounts/', + 'children//reports/feeding/amounts/', views.FeedingAmountsChildReport.as_view(), name='report-feeding-amounts-child' ), path( - 'children//reports/feeding/duration/', + 'children//reports/feeding/duration/', views.FeedingDurationChildReport.as_view(), name='report-feeding-duration-child' ), path( - 'children//reports/sleep/pattern/', + 'children//reports/sleep/pattern/', views.SleepPatternChildReport.as_view(), name='report-sleep-pattern-child' ), path( - 'children//reports/sleep/totals/', + 'children//reports/sleep/totals/', views.SleepTotalsChildReport.as_view(), name='report-sleep-totals-child' ), path( - 'children//reports/weight/weight/', + 'children//reports/weight/weight/', views.WeightWeightChildReport.as_view(), name='report-weight-weight-child' ),