From 6d0fb174ebf54576dd7b940d413d5830dcc6f68f Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 21 Dec 2022 15:42:30 +0100 Subject: [PATCH] Organise imports using isort --profile black --- nummi/main/admin.py | 2 +- nummi/main/migrations/0001_initial.py | 7 ++++--- ...ory_options_alter_invoice_options_and_more.py | 3 ++- ...ile_alter_invoice_file_alter_snapshot_date.py | 1 + nummi/main/models.py | 7 ++++--- nummi/main/views.py | 16 ++++++++-------- nummi/nummi/settings.py | 2 +- nummi/nummi/urls.py | 4 ++-- nummi/nummi/views.py | 2 +- nummi/plot/views.py | 14 ++++---------- 10 files changed, 28 insertions(+), 30 deletions(-) diff --git a/nummi/main/admin.py b/nummi/main/admin.py index ab84be8..2a4c794 100644 --- a/nummi/main/admin.py +++ b/nummi/main/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from .models import Transaction, Invoice, Category, Snapshot +from .models import Category, Invoice, Snapshot, Transaction admin.site.register(Transaction) admin.site.register(Invoice) diff --git a/nummi/main/migrations/0001_initial.py b/nummi/main/migrations/0001_initial.py index 7685e49..fae77ef 100644 --- a/nummi/main/migrations/0001_initial.py +++ b/nummi/main/migrations/0001_initial.py @@ -1,12 +1,13 @@ # Generated by Django 4.0.4 on 2022-05-22 07:45 import datetime -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion import re import uuid +import django.core.validators +import django.db.models.deletion +from django.db import migrations, models + class Migration(migrations.Migration): diff --git a/nummi/main/migrations/0006_alter_category_options_alter_invoice_options_and_more.py b/nummi/main/migrations/0006_alter_category_options_alter_invoice_options_and_more.py index 4a7ec37..e0bf69d 100644 --- a/nummi/main/migrations/0006_alter_category_options_alter_invoice_options_and_more.py +++ b/nummi/main/migrations/0006_alter_category_options_alter_invoice_options_and_more.py @@ -1,9 +1,10 @@ # Generated by Django 4.1.4 on 2022-12-20 14:26 import datetime + import django.core.validators -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/nummi/main/migrations/0007_snapshot_file_alter_invoice_file_alter_snapshot_date.py b/nummi/main/migrations/0007_snapshot_file_alter_invoice_file_alter_snapshot_date.py index c00239e..5a24ab9 100644 --- a/nummi/main/migrations/0007_snapshot_file_alter_invoice_file_alter_snapshot_date.py +++ b/nummi/main/migrations/0007_snapshot_file_alter_invoice_file_alter_snapshot_date.py @@ -1,6 +1,7 @@ # Generated by Django 4.1.4 on 2022-12-21 08:53 import datetime + import django.core.validators from django.db import migrations, models diff --git a/nummi/main/models.py b/nummi/main/models.py index a711f5c..c815532 100644 --- a/nummi/main/models.py +++ b/nummi/main/models.py @@ -1,11 +1,12 @@ import pathlib -from datetime import date import uuid +from datetime import date + +from django.core.files.storage import Storage +from django.core.validators import FileExtensionValidator from django.db import models from django.forms import ModelForm -from django.core.validators import FileExtensionValidator from django.utils.translation import gettext as _ -from django.core.files.storage import Storage class Category(models.Model): diff --git a/nummi/main/views.py b/nummi/main/views.py index dd4a2a5..e237547 100644 --- a/nummi/main/views.py +++ b/nummi/main/views.py @@ -1,21 +1,21 @@ -from django.shortcuts import render, get_object_or_404, redirect -from django.http import HttpResponse -from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views +from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin -from django.views.generic import ListView from django.core.paginator import Paginator from django.db import models +from django.http import HttpResponse +from django.shortcuts import get_object_or_404, redirect, render +from django.views.generic import ListView from .models import ( - Transaction, - TransactionForm, - Invoice, - InvoiceForm, Category, CategoryForm, + Invoice, + InvoiceForm, Snapshot, SnapshotForm, + Transaction, + TransactionForm, ) diff --git a/nummi/nummi/settings.py b/nummi/nummi/settings.py index 0536cfa..52da9aa 100644 --- a/nummi/nummi/settings.py +++ b/nummi/nummi/settings.py @@ -10,8 +10,8 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ -from pathlib import Path import os +from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/nummi/nummi/urls.py b/nummi/nummi/urls.py index 059f3e9..e933645 100644 --- a/nummi/nummi/urls.py +++ b/nummi/nummi/urls.py @@ -13,12 +13,12 @@ Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ +from django.conf import settings from django.conf.urls.i18n import i18n_patterns +from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path from django.views.generic.base import RedirectView -from django.conf import settings -from django.conf.urls.static import static from . import views diff --git a/nummi/nummi/views.py b/nummi/nummi/views.py index 866279f..15ffea3 100644 --- a/nummi/nummi/views.py +++ b/nummi/nummi/views.py @@ -1,6 +1,6 @@ from django.conf import settings -from django.http import HttpResponse from django.contrib.auth.decorators import login_required +from django.http import HttpResponse from django.views.static import serve diff --git a/nummi/plot/views.py b/nummi/plot/views.py index 90ddae2..115cc33 100644 --- a/nummi/plot/views.py +++ b/nummi/plot/views.py @@ -2,20 +2,14 @@ import io import matplotlib import matplotlib.pyplot as plt -from matplotlib import dates as mdates -from django.db import models from django.contrib.auth.decorators import login_required -from django.shortcuts import get_object_or_404 +from django.db import models from django.http import HttpResponse +from django.shortcuts import get_object_or_404 from django.utils.translation import gettext as _ +from matplotlib import dates as mdates -from main.models import ( - Transaction, - Invoice, - Category, - Snapshot, -) - +from main.models import Category, Invoice, Snapshot, Transaction matplotlib.use("Agg") plt.style.use("./plot/nummi.mplstyle")