Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to django v4.x #9

Merged
merged 27 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8ae1419
minor
csae8092 Nov 4, 2023
454ab27
add missing on_delete=models.SET_NULL on FK fields
csae8092 Nov 4, 2023
806e92b
removed sparql app
csae8092 Nov 4, 2023
ea52d0d
some dal fixes
csae8092 Nov 4, 2023
5eea657
fix for base_name -> basename
csae8092 Nov 4, 2023
e82ea26
url -> path, app_name
csae8092 Nov 4, 2023
d03e213
major url-path fix
csae8092 Nov 6, 2023
8ad2cfe
linting
csae8092 Nov 6, 2023
faaed6f
new middleware, removed import audit_log.models.fields
csae8092 Nov 6, 2023
ba5df8c
on_delete and audit_log
csae8092 Nov 6, 2023
5835161
fix (?) migrations
csae8092 Nov 6, 2023
5b6d529
template tag fix {% load static %}
csae8092 Nov 6, 2023
da4e907
laod static and fix for context in render
csae8092 Nov 6, 2023
b6e9b70
this makes static pages like start page work!!!!
csae8092 Nov 6, 2023
1c7ab82
fixed URL patterns
csae8092 Nov 6, 2023
85a5541
fix for drf default page size
csae8092 Nov 7, 2023
95e1b85
removed superfluos site list view
csae8092 Nov 7, 2023
edf7991
name -> field_name
csae8092 Nov 7, 2023
deef991
bootstrap3 template pack
csae8092 Nov 7, 2023
a6e7d97
more staticfiles -> static
csae8092 Nov 7, 2023
fcb2e0d
re added additional site list view (used for data curation)
csae8092 Nov 7, 2023
47730f7
closes #7 (events show up again)
csae8092 Nov 7, 2023
26a0c5b
yet another render_to_response fix
csae8092 Nov 7, 2023
2ca9b82
more loadstatic -> load
csae8092 Nov 7, 2023
dff570e
potential fix for 'id' expected a number but got <bound
csae8092 Nov 7, 2023
74c6e30
wip geolocation things
csae8092 Nov 7, 2023
ebc8d0e
fix for geolocation/site/show/
csae8092 Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ __try.html
orea/whoosh/*
/images_metadata/templates/images_metadata/*.bak
orea/settings/local.py
/env
7 changes: 4 additions & 3 deletions bib/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.urls import path
from . import views

app_name = "bib"
urlpatterns = [
url(r"^synczotero/$", views.sync_zotero, name="synczotero"),
url(r"^synczotero/result$", views.sync_zotero_action, name="synczotero_action"),
path("synczotero/", views.sync_zotero, name="synczotero"),
path("synczotero/result", views.sync_zotero_action, name="synczotero_action"),
]
27 changes: 14 additions & 13 deletions browsing/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,30 @@ class MapListFilter(django_filters.FilterSet):
)
period = django_filters.CharFilter(
label="Period",
name="area__period__period_name",
field_name="area__period__period_name",
distinct=True,
lookup_expr="icontains",
help_text=False,
)
period__cs_name = django_filters.CharFilter(
label="Period Chronological system",
help_text=False,
name="area__period__cs_name",
field_name="area__period__cs_name",
distinct=True,
lookup_expr="icontains",
)
area__period__start_date1_BC = django_filters.NumberFilter(
lookup_expr="lte",
label="Period start date 1 BC",
help_text="Lesser than or equal to",
name="area__period__start_date1_BC",
field_name="area__period__start_date1_BC",
distinct=True,
)
area__period__end_date1_BC = django_filters.NumberFilter(
lookup_expr="gte",
label="Period end date 1 BC",
help_text="Greater than or equal to",
name="area__period__end_date1_BC",
field_name="area__period__end_date1_BC",
distinct=True,
)
# area filters
Expand Down Expand Up @@ -353,6 +353,7 @@ class MapListFilter(django_filters.FilterSet):
class Meta:
model = Site
form = SiteFilterForm
fields = "__all__"


class SiteListFilter(django_filters.FilterSet):
Expand All @@ -370,30 +371,30 @@ class SiteListFilter(django_filters.FilterSet):
)
period = django_filters.CharFilter(
label="Period",
name="area__period__period_name",
field_name="area__period__period_name",
distinct=True,
lookup_expr="icontains",
help_text=False,
)
period__cs_name = django_filters.CharFilter(
label="Period Chronological system",
help_text=False,
name="area__period__cs_name",
field_name="area__period__cs_name",
distinct=True,
lookup_expr="icontains",
)
area__period__start_date1_BC = django_filters.NumberFilter(
lookup_expr="lte",
label="Period start date 1 BC",
help_text="Lesser than or equal to",
name="area__period__start_date1_BC",
field_name="area__period__start_date1_BC",
distinct=True,
)
area__period__end_date1_BC = django_filters.NumberFilter(
lookup_expr="gte",
label="Period end date 1 BC",
help_text="Greater than or equal to",
name="area__period__end_date1_BC",
field_name="area__period__end_date1_BC",
distinct=True,
)

Expand All @@ -417,14 +418,14 @@ class AreaListFilter(django_filters.FilterSet):
site__name = django_filters.CharFilter(lookup_expr="icontains", help_text=False)
period = django_filters.CharFilter(
label="Period",
name="period__period_name",
field_name="period__period_name",
distinct=True,
lookup_expr="icontains",
help_text=False,
)
period__cs_name = django_filters.CharFilter(
label="Period Chronological system",
name="period__cs_name",
field_name="period__cs_name",
distinct=True,
lookup_expr="icontains",
help_text=False,
Expand Down Expand Up @@ -583,15 +584,15 @@ class FindsListFilter(django_filters.FilterSet):
)
period = django_filters.CharFilter(
label="Period",
name="area__period__period_name",
field_name="area__period__period_name",
distinct=True,
lookup_expr="icontains",
help_text=False,
)
period__cs_name = django_filters.CharFilter(
label="Period Chronological system",
help_text=False,
name="area__period__cs_name",
field_name="area__period__cs_name",
distinct=True,
lookup_expr="icontains",
)
Expand Down Expand Up @@ -689,7 +690,7 @@ class ResearchEventListFilter(django_filters.FilterSet):
queryset=DC_researchevent_researchtype.objects.all(), help_text=False
)
institution = django_filters.CharFilter(
name="institution__name",
field_name="institution__name",
distinct=True,
lookup_expr="icontains",
help_text=False,
Expand Down
10 changes: 1 addition & 9 deletions browsing/forms.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import autocomplete_light
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, Field
from crispy_forms.layout import Submit, Layout, Fieldset
from defcdb.models import *
from .autocomplete_light_registry import SiteAutocomplete


class SiteFilterForm(forms.ModelForm):
name = autocomplete_light.ModelMultipleChoiceField(
Site.objects.all(),
required=False,
widget=autocomplete_light.MultipleChoiceWidget("SiteAutocomplete"),
)

class Meta:
model = Site
fields = ["name"]
Expand Down
2 changes: 1 addition & 1 deletion browsing/templates/browsing/generic_list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "defcdb/base.html" %}

{% load staticfiles %}
{% load static %}
{% load django_tables2 %}
{% load i18n %}
{% block Titel %} See all {{ object.classname }} {% endblock %}
Expand Down
33 changes: 18 additions & 15 deletions browsing/urls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
from django.conf.urls import url
from django.urls import path
from . import views


app_name = "browsing"

urlpatterns = [
url(r"download-sites/$", views.SiteDownloadView.as_view(), name="download-sites"),
url(r"download-areas/$", views.AreaDownloadView.as_view(), name="download-areas"),
url(r"download-finds/$", views.FindsDownloadView.as_view(), name="download-finds"),
url(
r"download-research-events/$",
path("download-sites/", views.SiteDownloadView.as_view(), name="download-sites"),
path("download-areas/", views.AreaDownloadView.as_view(), name="download-areas"),
path("download-finds/", views.FindsDownloadView.as_view(), name="download-finds"),
path(
"download-research-events/",
views.ResearchEventDownloadView.as_view(),
name="download-research-events",
),
url(
r"download-interpretations/$",
path(
"download-interpretations/",
views.InterpretationDownloadView.as_view(),
name="download-interpretations",
),
url(r"sites/$", views.SiteListView.as_view(), name="browse_sites"),
url(r"areas/$", views.AreaListView.as_view(), name="browse_areas"),
url(r"finds/$", views.FindsListView.as_view(), name="browse_finds"),
url(
r"research_events/$",
path("sites/", views.SiteListView.as_view(), name="browse_sites"),
path("areas/", views.AreaListView.as_view(), name="browse_areas"),
path("finds/", views.FindsListView.as_view(), name="browse_finds"),
path(
"research_events/",
views.ResearchEventListView.as_view(),
name="browse_researchevents",
),
url(
r"interpretations/$",
path(
"interpretations/",
views.InterpretationListView.as_view(),
name="browse_interpretations",
),
Expand Down
5 changes: 0 additions & 5 deletions browsing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@
InterpretationTable,
)
import csv
import re
import time
import datetime
import requests
from django.http import HttpResponse
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.template import RequestContext


def serialize(modelclass):
Expand Down
115 changes: 0 additions & 115 deletions defcdb/autocomplete_light_registry.py

This file was deleted.

Loading