Initial commit

This commit is contained in:
Your Name
2021-09-07 23:12:03 +08:00
commit 0f5e5327d8
354 changed files with 35438 additions and 0 deletions
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class ToolsConfig(AppConfig):
name = 'tools'
+28
View File
@@ -0,0 +1,28 @@
# Generated by Django 3.1.7 on 2021-06-29 16:20
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ToolsLibrary',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('name', models.CharField(blank=True, db_column='name', max_length=100)),
('sort', models.CharField(blank=True, db_column='sort', max_length=200)),
('example_file', models.CharField(blank=True, db_column='example_file', max_length=200)),
('show_chart', models.CharField(blank=True, db_column='show_chart', max_length=200)),
('visiting_time', models.IntegerField(db_column='visiting_time')),
('downlode_time', models.IntegerField(db_column='downlode_time')),
('page', models.IntegerField(db_column='page')),
('chart', models.CharField(blank=True, db_column='chart', max_length=200, null=True)),
],
),
]
+18
View File
@@ -0,0 +1,18 @@
# Generated by Django 3.1.7 on 2021-06-30 04:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tools', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='toolslibrary',
name='url',
field=models.CharField(blank=True, db_column='url', max_length=200),
),
]
@@ -0,0 +1,53 @@
# Generated by Django 3.1.7 on 2021-07-01 06:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tools', '0002_toolslibrary_url'),
]
operations = [
migrations.AlterField(
model_name='toolslibrary',
name='downlode_time',
field=models.IntegerField(blank=True, db_column='downlode_time', null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='example_file',
field=models.CharField(blank=True, db_column='example_file', max_length=200, null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='name',
field=models.CharField(blank=True, db_column='name', max_length=100, null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='page',
field=models.IntegerField(blank=True, db_column='page', null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='show_chart',
field=models.CharField(blank=True, db_column='show_chart', max_length=200, null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='sort',
field=models.CharField(blank=True, db_column='sort', max_length=200, null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='url',
field=models.CharField(blank=True, db_column='url', max_length=200, null=True),
),
migrations.AlterField(
model_name='toolslibrary',
name='visiting_time',
field=models.IntegerField(blank=True, db_column='visiting_time', null=True),
),
]
View File
+14
View File
@@ -0,0 +1,14 @@
from django.db import models
class ToolsLibrary(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(db_column='name', max_length=100, blank=True, null=True)
sort = models.CharField(db_column='sort', max_length=200, blank=True, null=True)
example_file = models.CharField(db_column='example_file', max_length=200, blank=True, null=True)
show_chart = models.CharField(db_column='show_chart', max_length=200, blank=True, null=True)
visiting_time = models.IntegerField(db_column='visiting_time', blank=True, null=True)
downlode_time = models.IntegerField(db_column='downlode_time', blank=True, null=True)
page = models.IntegerField(db_column='page', blank=True, null=True)
chart = models.CharField(db_column='chart', max_length=200, blank=True, null=True)
url = models.CharField(db_column='url', max_length=200, blank=True, null=True)
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+9
View File
@@ -0,0 +1,9 @@
from django.conf.urls import url
from tools import views
urlpatterns = [
url("(.*\.html$)", views.out_page),
url("id_transform", views.id_transform),
url("blast", views.blast)
]
+31
View File
@@ -0,0 +1,31 @@
import os
from django.http import JsonResponse
from django.shortcuts import render
from chart import tools
def out_page(request, page):
return render(request, f'/tools/{page}')
def id_transform(request):
file = request.FILES.get('file', None)
to = request.POST.get("to", None)
from_ = request.POST.get("from", None)
if file is None:
return JsonResponse({})
return JsonResponse({})
def blast(request):
file1 = request.FILES.get('file1', None)
pass