123456xjy 6 months ago
parent d62f72960c
commit 4d796d813c

Binary file not shown.

@ -92,7 +92,7 @@ class Migration(migrations.Migration):
('password', models.CharField(max_length=64, verbose_name='密码')), ('password', models.CharField(max_length=64, verbose_name='密码')),
('age', models.IntegerField(verbose_name='年龄')), ('age', models.IntegerField(verbose_name='年龄')),
('account', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='账户余额')), ('account', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='账户余额')),
('create_time', models.DateField(verbose_name='入职时间')), ('create_time', models.DateField(verbose_name='注册时间')),
('gender', models.SmallIntegerField(choices=[(1, ''), (2, '')], verbose_name='性别')), ('gender', models.SmallIntegerField(choices=[(1, ''), (2, '')], verbose_name='性别')),
], ],
), ),

@ -29,8 +29,8 @@ class UserInfo(models.Model):
password = models.CharField(verbose_name="密码", max_length=64) password = models.CharField(verbose_name="密码", max_length=64)
age = models.IntegerField(verbose_name="年龄") age = models.IntegerField(verbose_name="年龄")
account = models.DecimalField(verbose_name="账户余额", max_digits=10, decimal_places=2, default=0) account = models.DecimalField(verbose_name="账户余额", max_digits=10, decimal_places=2, default=0)
# create_time = models.DateTimeField(verbose_name="入职时间") # create_time = models.DateTimeField(verbose_name="注册时间")
create_time = models.DateField(verbose_name="入职时间") create_time = models.DateField(verbose_name="注册时间")
gender_choices = ( gender_choices = (
(1, ""), (1, ""),
(2, ""), (2, ""),
@ -42,12 +42,6 @@ class Movie(models.Model):
depart = models.ForeignKey(verbose_name="电影类别", to="Department", to_field="id", on_delete=models.CASCADE) depart = models.ForeignKey(verbose_name="电影类别", to="Department", to_field="id", on_delete=models.CASCADE)
desc = models.CharField(verbose_name='影片描述', max_length=256,default = '') desc = models.CharField(verbose_name='影片描述', max_length=256,default = '')
#什么东西啊啊啊
class Order(models.Model): class Order(models.Model):
""" 订单 """ """ 订单 """
oid = models.CharField(verbose_name="订单号", max_length=64) oid = models.CharField(verbose_name="订单号", max_length=64)

@ -37,8 +37,8 @@
<div class="form-group"> <div class="form-group">
<label>入职时间</label> <label>注册时间</label>
<input id="dt" type="text" autocomplete="off" class="form-control" placeholder="入职时间" name="ctime"/> <input id="dt" type="text" autocomplete="off" class="form-control" placeholder="注册时间" name="ctime"/>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -37,7 +37,7 @@
<th>密码</th> <th>密码</th>
<th>年龄</th> <th>年龄</th>
<th>余额</th> <th>余额</th>
<th>入职时间</th> <th>注册时间</th>
<th>性别</th> <th>性别</th>
<th>操作</th> <th>操作</th>
</tr> </tr>

@ -6,9 +6,9 @@ from app01.utils.form import UserModelForm
def depart_list(request): def depart_list(request):
""" 部门列表 """ """ 电影类别"""
# 去数据库中获取所有的部门列表 # 去数据库中获取所有的电影类别
# [对象,对象,对象] # [对象,对象,对象]
queryset = models.Department.objects.all() queryset = models.Department.objects.all()
@ -16,7 +16,7 @@ def depart_list(request):
def depart_add(request): def depart_add(request):
""" 添加部门 """ """ 添加类别 """
if request.method == "GET": if request.method == "GET":
return render(request, 'depart_add.html') return render(request, 'depart_add.html')
@ -26,24 +26,24 @@ def depart_add(request):
# 保存到数据库 # 保存到数据库
models.Department.objects.create(title=title) models.Department.objects.create(title=title)
# 重定向回部门列表 # 重定向回类别列表
return redirect("/depart/list/") return redirect("/depart/list/")
def depart_delete(request): def depart_delete(request):
""" 删除部门 """ """ 删除电影类别 """
# 获取ID http://127.0.0.1:8000/depart/delete/?nid=1 # 获取ID http://127.0.0.1:8000/depart/delete/?nid=1
nid = request.GET.get('nid') nid = request.GET.get('nid')
# 删除 # 删除
models.Department.objects.filter(id=nid).delete() models.Department.objects.filter(id=nid).delete()
# 重定向回部门列表 # 重定向回电影类别
return redirect("/depart/list/") return redirect("/depart/list/")
def depart_edit(request, nid): def depart_edit(request, nid):
""" 修改部门 """ """ 修改类别 """
if request.method == "GET": if request.method == "GET":
# 根据nid获取他的数据 [obj,] # 根据nid获取他的数据 [obj,]
row_object = models.Department.objects.filter(id=nid).first() row_object = models.Department.objects.filter(id=nid).first()
@ -56,7 +56,7 @@ def depart_edit(request, nid):
# models.Department.objects.filter(id=nid).update(title=title,其他=123) # models.Department.objects.filter(id=nid).update(title=title,其他=123)
models.Department.objects.filter(id=nid).update(title=title) models.Department.objects.filter(id=nid).update(title=title)
# 重定向回部门列表 # 重定向回电影类别
return redirect("/depart/list/") return redirect("/depart/list/")

@ -23,7 +23,7 @@ from app01.views import depart, user, admin, account, order,movie
urlpatterns = [ urlpatterns = [
# path('admin/', admin.site.urls), # path('admin/', admin.site.urls),
# 部门管理 # 电影类别管理
path('depart/list/', depart.depart_list), path('depart/list/', depart.depart_list),
path('depart/add/', depart.depart_add), path('depart/add/', depart.depart_add),
path('depart/delete/', depart.depart_delete), path('depart/delete/', depart.depart_delete),
@ -59,11 +59,8 @@ urlpatterns = [
path('order/detail/', order.order_detail), path('order/detail/', order.order_detail),
path('order/edit/', order.order_edit), path('order/edit/', order.order_edit),
# 数据统计
# 上传文件
# 电影信息管理 # 电影信息管理
path('movie/list/',movie.movie_list), path('movie/list/',movie.movie_list),

Loading…
Cancel
Save