Optimized imports

Signed-off-by: Etzelia <etzelia@hotmail.com>

# Conflicts:
#	gui.py
coords
jolheiser 2022-02-10 20:17:38 -06:00
parent dac77b4c08
commit 8887559cf4
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
5 changed files with 18 additions and 33 deletions

View File

@ -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

4
gui.py
View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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):