From f21a838488be976e6d01e2b6e39f627417eb20fe Mon Sep 17 00:00:00 2001 From: Saqibur Rahman Date: Sat, 25 Nov 2023 23:47:46 +0600 Subject: [PATCH] Black: Fix formatting inconsistencies --- apps/core/apps.py | 4 +-- apps/core/models.py | 26 +++++++---------- config/asgi.py | 2 +- config/settings.py | 68 +++++++++++++++++++++++---------------------- config/wsgi.py | 2 +- manage.py | 4 +-- 6 files changed, 51 insertions(+), 55 deletions(-) diff --git a/apps/core/apps.py b/apps/core/apps.py index 8115ae6..c0ce093 100644 --- a/apps/core/apps.py +++ b/apps/core/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class CoreConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'core' + default_auto_field = "django.db.models.BigAutoField" + name = "core" diff --git a/apps/core/models.py b/apps/core/models.py index 4c94919..3daa852 100644 --- a/apps/core/models.py +++ b/apps/core/models.py @@ -9,42 +9,36 @@ user_model = settings.AUTH_USER_MODEL class BaseModel(models.Model): uid = models.UUIDField( - verbose_name=_('UUID'), - unique=True, - default=uuid.uuid4, - editable=False + verbose_name=_("UUID"), unique=True, default=uuid.uuid4, editable=False ) created_by = models.ForeignKey( to=user_model, - verbose_name=_('Created by'), + verbose_name=_("Created by"), null=True, blank=True, - related_name='%(class)s_created', - on_delete=models.SET_NULL + related_name="%(class)s_created", + on_delete=models.SET_NULL, ) created_at = models.DateTimeField( - verbose_name=_('Created at'), + verbose_name=_("Created at"), auto_now_add=True, editable=False, - db_index=True + db_index=True, ) updated_by = models.ForeignKey( to=user_model, - verbose_name=_('Updated by'), + verbose_name=_("Updated by"), null=True, blank=True, - related_name='%(class)s_updated', - on_delete=models.SET_NULL + related_name="%(class)s_updated", + on_delete=models.SET_NULL, ) updated_at = models.DateTimeField( - verbose_name=_('Updated at'), - auto_now=True, - null=True, - blank=True + verbose_name=_("Updated at"), auto_now=True, null=True, blank=True ) class Meta: diff --git a/config/asgi.py b/config/asgi.py index f2191c2..872a3e7 100644 --- a/config/asgi.py +++ b/config/asgi.py @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") application = get_asgi_application() diff --git a/config/settings.py b/config/settings.py index 7daa90e..398ed23 100644 --- a/config/settings.py +++ b/config/settings.py @@ -20,7 +20,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a' +SECRET_KEY = ( + "django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a" +) ALLOWED_HOSTS = [] @@ -28,43 +30,43 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", ] MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = 'config.urls' +ROOT_URLCONF = "config.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'config.wsgi.application' +WSGI_APPLICATION = "config.wsgi.application" # Password validation @@ -72,16 +74,16 @@ WSGI_APPLICATION = 'config.wsgi.application' AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -89,9 +91,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/4.0/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" -TIME_ZONE = 'UTC' +TIME_ZONE = "UTC" USE_I18N = True @@ -101,11 +103,11 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.0/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = "static/" # Default primary key field type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" DEBUG = True diff --git a/config/wsgi.py b/config/wsgi.py index 08031f8..55ec642 100644 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") application = get_wsgi_application() diff --git a/manage.py b/manage.py index 8e7ac79..d28672e 100644 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +18,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main()