Модель
class StandardModel(models.Model):
'Базовые шкафы'
title = models.CharField(max_length=200, verbose_name='Название')
article = models.CharField(max_length=10, unique=True, verbose_name='Артикул')
qdoors = models.SmallIntegerField(choices=QUANTITY_DOORS, default=2, verbose_name='Количество дверей')
type_case = models.CharField(max_length=10, choices=TYPE_CASE, default='case', verbose_name='Тип корпуса')
.....
def get_absolute_url(self):
return reverse('basiccaseitem', args=[str(self.pk)])
URL.py
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('base/case/', views.BasicView.as_view(), {'filter': 'case'}, name='basiccase'),
path('base/case/<int:pk>/', views.BasicItemView.as_view(), {'filter': 'case'}, name='basiccaseitem'),
path('base/built-in/', views.BasicView.as_view(), {'filter': 'built-in'}, name='basicbuiltin'),
path('base/built-in/<int:pk>/', views.BasicItemView.as_view(), {'filter': 'built-in'}, name='basicbuiltinitem'),
path('base/doors/', views.DoorsView.as_view(), name='doors'),
path('base/doors/<int:pk>/', views.DoorsItemView.as_view(), name='doorsitem'),
path('works/', views.WorksView.as_view(), name='works'),
path('works/<int:pk>/', views.WorksItemView.as_view(), name='worksid'),
]