优化我的站点信息展示

This commit is contained in:
ngfchl
2022-09-14 13:04:50 +08:00
parent 6140286294
commit 059a176b56
12 changed files with 106 additions and 54 deletions

0
util/__init__.py Normal file
View File

3
util/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
util/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class UtilConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'util'

View File

3
util/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

10
util/templatetags/size.py Normal file
View File

@@ -0,0 +1,10 @@
from django import template
from pt_site.UtilityTool import FileSizeConvert
register = template.Library()
@register.filter(name='file_2_size')
def file_2_size(value):
return FileSizeConvert.parse_2_file_size(int(value))

3
util/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
util/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.