parent
2059aeb2d1
commit
37dd8e52a4
28
admin.py
28
admin.py
|
@ -1,11 +1,11 @@
|
||||||
|
import ast
|
||||||
|
|
||||||
|
from django import forms
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.admin import widgets as admin_widgets
|
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, \
|
from django_coreprotect.models import CoWorld, Preset
|
||||||
CoEntity, CoEntityMap, CoMaterialMap, CoSession, CoSign, CoSkull, CoUser, CoUsernameLog, CoVersion, CoWorld, Preset
|
from django_coreprotect.utils import time_to_form, form_to_time
|
||||||
|
|
||||||
|
|
||||||
class PresetAdminForm(forms.ModelForm):
|
class PresetAdminForm(forms.ModelForm):
|
||||||
|
@ -49,24 +49,6 @@ class PresetAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
try:
|
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)
|
admin.site.register(Preset, PresetAdmin)
|
||||||
except admin.sites.AlreadyRegistered:
|
except admin.sites.AlreadyRegistered:
|
||||||
pass
|
pass
|
||||||
|
|
3
gui.py
3
gui.py
|
@ -1,6 +1,7 @@
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from django_coreprotect.models import CoWorld, GUIResult
|
from django_coreprotect.models import CoWorld, GUIResult
|
||||||
from django_coreprotect.utils import safe_int, checkbox, time_to_form
|
from django_coreprotect.utils import safe_int, checkbox, time_to_form
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
|
|
||||||
class GUIForm:
|
class GUIForm:
|
||||||
|
|
|
@ -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 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
|
from django_coreprotect.utils import safe_int
|
||||||
|
|
||||||
|
|
||||||
|
|
3
utils.py
3
utils.py
|
@ -1,5 +1,6 @@
|
||||||
from datetime import datetime, timedelta
|
|
||||||
import ast
|
import ast
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
def checkbox(value):
|
def checkbox(value):
|
||||||
return True if value == "on" else False
|
return True if value == "on" else False
|
||||||
|
|
7
views.py
7
views.py
|
@ -1,10 +1,11 @@
|
||||||
|
from django.http.response import JsonResponse
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.views.generic import View
|
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.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.models import Preset
|
||||||
|
from django_coreprotect.utils import safe_int
|
||||||
|
|
||||||
|
|
||||||
class GUI(View):
|
class GUI(View):
|
||||||
|
|
Loading…
Reference in New Issue