提交 018f2c71 编写于 作者: N newpanjing

add readme.md

上级 57a31546
无法预览此类型文件
from django.contrib import admin
from finance.models import *
# Register your models here.
@admin.register(Record)
class RecordAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'type', 'money', 'create_date')
list_per_page = 10
from django.apps import AppConfig
class FinanceConfig(AppConfig):
name = 'finance'
# Generated by Django 2.2 on 2019-04-08 03:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Record',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='每一笔款项描述', max_length=128, verbose_name='收支项')),
('money', models.DecimalField(decimal_places=2, max_digits=9, verbose_name='金额')),
('create_date', models.DateTimeField(auto_now=True, verbose_name='时间')),
('type', models.IntegerField(choices=[(0, '收入'), (1, '支出')], verbose_name='类型')),
],
options={
'verbose_name': '收支',
'verbose_name_plural': '收支记录',
},
),
]
from django.db import models
# Create your models here.
class Record(models.Model):
name = models.CharField(verbose_name='收支项', max_length=128, help_text='每一笔款项描述')
money = models.DecimalField(verbose_name='金额', decimal_places=2, max_digits=9)
create_date = models.DateTimeField(verbose_name='时间', auto_now=True)
type_choices = (
(0, '收入'),
(1, '支出'),
)
type = models.IntegerField(verbose_name='类型', choices=type_choices)
class Meta:
verbose_name = "收支"
verbose_name_plural = "收支记录"
def __str__(self):
return self.name
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
......@@ -105,6 +105,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'zh-hans'
# LANGUAGE_CODE = 'en-us'
# LANGUAGE_CODE = 'ja'
TIME_ZONE = 'Asia/Shanghai'
......@@ -131,5 +132,41 @@ STATIC_ROOT = os.path.join(BASE_DIR, "static")
# SIMPLEUI_HOME_PAGE = 'https://www.baidu.com'
# 首页标题
# SIMPLEUI_HOME_TITLE = '百度一下你就知道'
# 首页图标,支持element-ui的图和fontawesome的图标
# 首页图标,支持element-ui的图和fontawesome的图标
# SIMPLEUI_HOME_ICON = 'el-icon-date'
# 自定义SIMPLEUI的Logo
# SIMPLEUI_LOGO = 'https://avatars2.githubusercontent.com/u/13655483?s=60&v=4'
# 让simpleui 不要收集相关信息
SIMPLEUI_ANALYSIS = True
# 自定义simpleui 菜单
# SIMPLEUI_CONFIG = {
# 'menus': [{
# 'name': 'Simpleui',
# 'icon': 'fas fa-code',
# 'url': 'https://gitee.com/tompeppa/simpleui'
# }, {
# 'app': 'auth',
# 'name': '权限认证',
# 'icon': 'fas fa-user-shield',
# 'models': [{
# 'name': '用户',
# 'icon': 'fa fa-user',
# 'url': 'auth/user/'
# }]
# }, {
# 'name': '测试',
# 'icon': 'fa fa-file',
# 'models': [{
# 'name': 'Baidu',
# 'url': 'http://baidu.com',
# 'icon': 'far fa-surprise'
# }, {
# 'name': '内网穿透',
# 'url': 'https://www.wezoz.com',
# 'icon': 'fab fa-github'
# }]
# }]
# }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册