Base filled up

This commit is contained in:
Eden Kirin
2024-04-11 16:04:25 +02:00
parent 163f59844f
commit b1ecdd1f0c
5 changed files with 13659 additions and 6781 deletions

View File

@ -3,7 +3,7 @@
from django.db import migrations
counties = [
'KoprivničkO-križevačka',
'Koprivničko-križevačka',
'Međimurska',
'Dubrovačko-neretvanska',
'Zagrebačka',

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,7 @@
import shutil
from pathlib import Path
from django.conf import settings
from django.urls import path
from project.main import views
@ -8,8 +12,30 @@ urlpatterns = [
path("filter-list", views.FilterListView.as_view(), name="filter-list"),
path("form-validation", views.FormValidationView.as_view(), name="form-validation"),
path("complex-form", views.ComplexFormView.as_view(), name="complex-form"),
path("complex-form/handle/route-module", views.RouteModuleHandleView.as_view(), name="complex-form-handle-route-module"),
path("complex-form/handle/reports", views.ReportsHandleView.as_view(), name="complex-form-handle-reports"),
path("complex-form/handle/warehouse-management", views.WarehouseManagementHandleView.as_view(), name="complex-form-handle-warehouse-management"),
path("table-inline-edit", views.TableInlineEditView.as_view(), name="table-inline-edit"),
path(
"complex-form/handle/route-module",
views.RouteModuleHandleView.as_view(),
name="complex-form-handle-route-module",
),
path(
"complex-form/handle/reports",
views.ReportsHandleView.as_view(),
name="complex-form-handle-reports",
),
path(
"complex-form/handle/warehouse-management",
views.WarehouseManagementHandleView.as_view(),
name="complex-form-handle-warehouse-management",
),
path(
"table-inline-edit",
views.TableInlineEditView.as_view(),
name="table-inline-edit",
),
]
# check if db exists, and copy from template if not
if not Path.exists(settings.DATABASES["default"]["NAME"]):
template_filename = settings.BASE_DIR / "db.template.sqlite3"
shutil.copyfile(template_filename, settings.DATABASES["default"]["NAME"])
print("Database copied from template.")