From 8887559cf437841dec3864527b4d95b806cea7e9 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Thu, 10 Feb 2022 20:17:38 -0600 Subject: [PATCH] Optimized imports Signed-off-by: Etzelia # Conflicts: # gui.py --- admin.py | 28 +++++----------------------- gui.py | 4 ++-- models.py | 9 +++++---- utils.py | 3 ++- views.py | 7 ++++--- 5 files changed, 18 insertions(+), 33 deletions(-) diff --git a/admin.py b/admin.py index dd42891..cbda5b9 100644 --- a/admin.py +++ b/admin.py @@ -1,11 +1,11 @@ +import ast + +from django import forms from django.contrib import admin from django.contrib.admin import widgets as admin_widgets -from django import forms -import ast -from django_coreprotect.utils import time_to_form, form_to_time -from django_coreprotect.models import CoArtMap, CoBlock, CoBlockdataMap, CoChat, CoCommand, CoContainer, CoDatabaseLock, \ - CoEntity, CoEntityMap, CoMaterialMap, CoSession, CoSign, CoSkull, CoUser, CoUsernameLog, CoVersion, CoWorld, Preset +from django_coreprotect.models import CoWorld, Preset +from django_coreprotect.utils import time_to_form, form_to_time class PresetAdminForm(forms.ModelForm): @@ -49,24 +49,6 @@ class PresetAdmin(admin.ModelAdmin): try: - pass - # admin.site.register(CoArtMap) - # admin.site.register(CoBlock) - # admin.site.register(CoBlockdataMap) - # admin.site.register(CoChat) - # admin.site.register(CoCommand) - # admin.site.register(CoContainer) - # admin.site.register(CoDatabaseLock) - # admin.site.register(CoEntity) - # admin.site.register(CoEntityMap) - # admin.site.register(CoMaterialMap) - # admin.site.register(CoSession) - # admin.site.register(CoSign) - # admin.site.register(CoSkull) - # admin.site.register(CoUser) - # admin.site.register(CoUsernameLog) - # admin.site.register(CoVersion) - # admin.site.register(CoWorld) admin.site.register(Preset, PresetAdmin) except admin.sites.AlreadyRegistered: pass diff --git a/gui.py b/gui.py index 767cebd..b902502 100644 --- a/gui.py +++ b/gui.py @@ -1,7 +1,7 @@ +from datetime import datetime + from django_coreprotect.models import CoWorld, GUIResult from django_coreprotect.utils import safe_int, checkbox, time_to_form -from datetime import datetime -from django.db import connection class GUIForm: diff --git a/models.py b/models.py index f611f71..15bede9 100644 --- a/models.py +++ b/models.py @@ -1,8 +1,9 @@ -from django.db import models -from django.db.models import Q -from django.shortcuts import reverse -from django.contrib.auth.models import User from datetime import datetime + +from django.contrib.auth.models import User +from django.db import models +from django.shortcuts import reverse + from django_coreprotect.utils import safe_int diff --git a/utils.py b/utils.py index 77762c6..c8ddeae 100644 --- a/utils.py +++ b/utils.py @@ -1,5 +1,6 @@ -from datetime import datetime, timedelta import ast +from datetime import datetime, timedelta + def checkbox(value): return True if value == "on" else False diff --git a/views.py b/views.py index 3a80f30..1596230 100644 --- a/views.py +++ b/views.py @@ -1,10 +1,11 @@ +from django.http.response import JsonResponse from django.shortcuts import render from django.views.generic import View -from django.http.response import JsonResponse -from django_coreprotect.gui import gui_data, gui_results + from django_coreprotect.activity import activity_data, activity_results -from django_coreprotect.utils import safe_int +from django_coreprotect.gui import gui_data, gui_results from django_coreprotect.models import Preset +from django_coreprotect.utils import safe_int class GUI(View):