mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
优化我的站点信息展示
This commit is contained in:
0
util/__init__.py
Normal file
0
util/__init__.py
Normal file
3
util/admin.py
Normal file
3
util/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
util/apps.py
Normal file
6
util/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class UtilConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'util'
|
||||
0
util/migrations/__init__.py
Normal file
0
util/migrations/__init__.py
Normal file
3
util/models.py
Normal file
3
util/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
0
util/templatetags/__init__.py
Normal file
0
util/templatetags/__init__.py
Normal file
10
util/templatetags/size.py
Normal file
10
util/templatetags/size.py
Normal 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
3
util/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
util/views.py
Normal file
3
util/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user