Skip to content

Commit

Permalink
Make fields frozen by default (#7)
Browse files Browse the repository at this point in the history
- Make fields frozen by default to disallow changing the settings after initialization
  • Loading branch information
vsakkas authored Jul 7, 2024
1 parent 33121b4 commit a0d8692
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Django Base Settings

[![Latest Release](https://img.shields.io/github/v/release/vsakkas/django-base-settings.svg?color=187f58)](https://github.com/vsakkas/django-base-settings/releases/tag/v0.3.0)
[![Latest Release](https://img.shields.io/github/v/release/vsakkas/django-base-settings.svg?color=187f58)](https://github.com/vsakkas/django-base-settings/releases/tag/v0.4.0)
[![Python](https://img.shields.io/badge/python-3.10+-187f58.svg)](https://www.python.org/downloads/)
[![Django Version](https://img.shields.io/badge/django-5.0+-187f58)](https://www.djangoproject.com/)
[![MIT License](https://img.shields.io/badge/license-MIT-187f58)](https://github.com/vsakkas/django-base-settings/blob/master/LICENSE)
Expand Down
6 changes: 4 additions & 2 deletions django_base_settings/django_base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@


class BaseModel(_BaseModel):
model_config = ConfigDict(alias_generator=lambda field_name: field_name.upper())
model_config = ConfigDict(
alias_generator=lambda field_name: field_name.upper(), frozen=True
)


class BaseSettings(_BaseSettings):
model_config = SettingsConfigDict(
alias_generator=lambda field_name: field_name.upper()
alias_generator=lambda field_name: field_name.upper(), frozen=True
)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-base-settings"
version = "0.3.0"
version = "0.4.0"
description = "Use Pydantic to enhance your Django application settings."
authors = ["vsakkas <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit a0d8692

Please sign in to comment.