Implement initial drug search

This commit is contained in:
2024-03-26 17:06:44 +00:00
parent b924c0556c
commit 6131c58857
30 changed files with 1639 additions and 123 deletions

View File

@@ -49,3 +49,16 @@ if DEBUG:
]
SETTINGS_EXPORT = ["BILLING_ENABLED"]
MAIN_SIZES = ["1", "5", "15", "30", "50", "100", "250", "500", "1000"]
MAIN_SIZES_ANON = ["1", "5", "15", "30", "50", "100"]
MAIN_SOURCES = ["substances", "experiences", "all"]
# CACHE = False
# CACHE_TIMEOUT = 2
DRUGS_RESULTS_PER_PAGE = 15
DRUGS_DEFAULT_PARAMS = {
"size": "15",
"sorting": "desc",
"source": "substances",
}

View File

@@ -41,8 +41,8 @@ INSTALLED_APPS = [
"django_htmx",
"crispy_forms",
"crispy_bulma",
# "django_tables2",
# "django_tables2_bulma_template",
"django_tables2",
"django_tables2_bulma_template",
"django_otp",
"django_otp.plugins.otp_totp",
# "django_otp.plugins.otp_email",

View File

@@ -24,7 +24,8 @@ from core.views import base, demo, drugs, notifications, search
urlpatterns = [
path("__debug__/", include("debug_toolbar.urls")),
path("", base.Home.as_view(), name="home"),
path("", search.DrugsTableView.as_view(), name="home"),
# path("", base.Home.as_view(), name="home"),
path("admin/", admin.site.urls),
# 2FA login urls
path("", include(tf_urls)),
@@ -67,5 +68,6 @@ urlpatterns = [
name="drug_pull_merge",
),
# Drug search
path("search/<str:type>/", search.Search.as_view(), name="search"),
path("search/", search.DrugsTableView.as_view(), name="search"),
path("search/partial/", search.DrugsTableView.as_view(), name="search_partial"),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)