123456xjy 6 months ago
parent a4830ed325
commit 01f74df555

@ -14,7 +14,7 @@
</component> </component>
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (django)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.8" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="TemplatesService"> <component name="TemplatesService">

@ -6,5 +6,5 @@
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="ES6" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (django)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
</project> </project>

Binary file not shown.

@ -0,0 +1,18 @@
# Generated by Django 2.0 on 2024-05-30 14:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app01', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='movie',
name='desc',
field=models.CharField(default='', max_length=256, verbose_name='影片描述'),
),
]

@ -56,6 +56,7 @@ class UserInfo(models.Model):
class Movie(models.Model): class Movie(models.Model):
name = models.CharField(verbose_name="电影名称", max_length=16) name = models.CharField(verbose_name="电影名称", max_length=16)
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 = '')
class PrettyNum(models.Model): class PrettyNum(models.Model):

@ -49,6 +49,7 @@
<li><a href="/movie/list/">电影信息</a></li> <li><a href="/movie/list/">电影信息</a></li>
<li><a href="/depart/list/">电影分类</a></li> <li><a href="/depart/list/">电影分类</a></li>
<li><a href="/order/list/">订单中心</a></li> <li><a href="/order/list/">订单中心</a></li>
<li><a href="#">留言管理</a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">

@ -36,6 +36,7 @@
<th>ID</th> <th>ID</th>
<th>名称</th> <th>名称</th>
<th>电影分类</th> <th>电影分类</th>
<th>影片描述</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
@ -45,6 +46,7 @@
<th>{{ obj.id }}</th> <th>{{ obj.id }}</th>
<td>{{ obj.name }}</td> <td>{{ obj.name }}</td>
<td>{{ obj.depart.title }}</td> <td>{{ obj.depart.title }}</td>
<td>{{ obj.desc }}</td>
<td> <td>
<a class="btn btn-primary btn-xs" href="/movie/{{ obj.id }}/edit/">编辑</a> <a class="btn btn-primary btn-xs" href="/movie/{{ obj.id }}/edit/">编辑</a>
<a class="btn btn-danger btn-xs" href="/movie/{{ obj.id }}/delete/">删除</a> <a class="btn btn-danger btn-xs" href="/movie/{{ obj.id }}/delete/">删除</a>

@ -87,9 +87,6 @@ DATABASES = {
'PASSWORD': '1234', 'PASSWORD': '1234',
'HOST': '127.0.0.1', # 那台机器安装了MySQL 'HOST': '127.0.0.1', # 那台机器安装了MySQL
'PORT': 3306, 'PORT': 3306,
'OPTIONS': {
'charset': 'utf8mb4',
},
} }
} }

@ -41,7 +41,7 @@ urlpatterns = [
path('user/<int:nid>/edit/', user.user_edit), path('user/<int:nid>/edit/', user.user_edit),
path('user/<int:nid>/delete/', user.user_delete), path('user/<int:nid>/delete/', user.user_delete),
# 号管理 # 号管理
path('pretty/list/', pretty.pretty_list), path('pretty/list/', pretty.pretty_list),
path('pretty/add/', pretty.pretty_add), path('pretty/add/', pretty.pretty_add),
path('pretty/<int:nid>/edit/', pretty.pretty_edit), path('pretty/<int:nid>/edit/', pretty.pretty_edit),

Loading…
Cancel
Save