Skip to content

Commit

Permalink
152 migrate to pydantic v2 (#167)
Browse files Browse the repository at this point in the history
* style: updated pre commit to latest versions

* feat: first migration to pydantic V2, using pydjantic for settings

* chore: remove unused setup in wsgi/asgi

* feat: use custom mapping for settings

* fix: pydjantic base_dir

* fix: rework pydjantic

* fix: adding prefix to use same database env

* fix: change env to alias for pydantic v2

* test: test logging settings

* fix: include media folder

* fix: fixed dependency conflict

* fix: fixed error for class variable

* chore: adapt pydantic changes in jsonschem parser

* chore(entirety): update requirements

* fix(entirety): error after updating filip

* docs(sdm): examples for tested smart data models with new parser

* fix(entity): invoking of get_context_data

* chore(entity): remove ' from example json schema model

* chore(entirety): update default login_url

* fix(entirety): add work around for conflict of jsonschemaparser

* chore(entity): use default as value while parsing data models

* chore(entirety): update login url

* fix(entirety): default attr value and datetime type

* fix(semantic): migration error

---------

Co-authored-by: Saira Bano <[email protected]>
  • Loading branch information
djs0109 and sbanoeon authored Oct 10, 2024
1 parent 739e27e commit 90552b3
Show file tree
Hide file tree
Showing 13 changed files with 270 additions and 183 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ pip

```bash
cd ./app/Entirety
pip install -e git+https://jugit.fz-juelich.de/iek-10/public/ict-platform/fiware-applications/[email protected]#egg=jsonschemaparser
pip install -r requirements.txt
```
> **Note:** The jsonschemaparser is a package from a repository.
> It might cause conflicts with other libs. Therefore, we install it separately.
> Please ignore the relevant ERROR message.
pre-commit

Expand Down Expand Up @@ -94,7 +98,7 @@ provide following settings in your env file.

For a full list of settings see [settings](./docs/SETTINGS.md).

## User and permissions model
## User and permissions model

The user and permissions model of _Entirety_ is described in the [user model documentation](./docs/USERMODEL.md).

Expand All @@ -118,14 +122,14 @@ See [changelog](./docs/CHANGELOG.md) for detailed overview of changes.

## Further project information

<a href="https://n5geh.de/"> <img alt="National 5G Energy Hub"
<a href="https://n5geh.de/"> <img alt="National 5G Energy Hub"
src="https://raw.githubusercontent.com/N5GEH/n5geh.platform/master/docs/logos/n5geh-logo.png" height="100"></a>

## Acknowledgments

We gratefully acknowledge the financial support of the Federal Ministry <br />
for Economic Affairs and Climate Action (BMWK), promotional references
We gratefully acknowledge the financial support of the Federal Ministry <br />
for Economic Affairs and Climate Action (BMWK), promotional references
03EN1030B and 03ET1561B.

<a href="https://www.bmwi.de/Navigation/EN/Home/home.html"> <img alt="BMWK"
<a href="https://www.bmwi.de/Navigation/EN/Home/home.html"> <img alt="BMWK"
src="https://raw.githubusercontent.com/N5GEH/n5geh.platform/master/docs/logos/BMWK-logo_en.png" height="100"> </a>
2 changes: 1 addition & 1 deletion app/Entirety/.env.EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LOKI_SRC_HOST=entirety
LOKI_TIMEZONE=Europe/Berlin

LOCAL_AUTH=True
LOGIN_URL=/
LOGIN_URL=/accounts/login
LOGIN_REDIRECT_URL=/
LOGOUT_REDIRECT_URL=/
# OIDC
Expand Down
4 changes: 1 addition & 3 deletions app/Entirety/entirety/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import os

from django.core.asgi import get_asgi_application
from pydantic_settings import SetUp

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "entirety.settings.Settings")
SetUp().configure()
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "entirety.settings")
application = get_asgi_application()
Loading

0 comments on commit 90552b3

Please sign in to comment.