parent
3631f5ca24
commit
26ca8e87b4
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,112 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-02 04:11
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Genre',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, verbose_name='类型')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '电影类型',
|
||||
'verbose_name_plural': '电影类型',
|
||||
'db_table': 'Genre',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Movie',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=256, verbose_name='电影名')),
|
||||
('imdb_id', models.IntegerField(verbose_name='imdb_id')),
|
||||
('time', models.CharField(blank=True, max_length=256, verbose_name='时长')),
|
||||
('release_time', models.CharField(blank=True, max_length=256, verbose_name='发行时间')),
|
||||
('intro', models.TextField(blank=True, verbose_name='简介')),
|
||||
('director', models.CharField(blank=True, max_length=256, verbose_name='导演')),
|
||||
('actor', models.CharField(blank=True, max_length=256, verbose_name='演员')),
|
||||
('writers', models.CharField(blank=True, max_length=256, verbose_name='编剧')),
|
||||
('genre', models.ManyToManyField(to='movie.genre', verbose_name='类型')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '电影信息',
|
||||
'verbose_name_plural': '电影信息',
|
||||
'db_table': 'Movie',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Movie_hot',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('rating_number', models.IntegerField(verbose_name='评分人数')),
|
||||
('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.movie', verbose_name='电影名')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '最热电影',
|
||||
'verbose_name_plural': '最热电影',
|
||||
'db_table': 'Movie_hot',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Movie_rating',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('score', models.FloatField(verbose_name='评分')),
|
||||
('comment', models.TextField(blank=True, verbose_name='评论')),
|
||||
('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.movie', verbose_name='电影')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '电影评分信息',
|
||||
'verbose_name_plural': '电影评分信息',
|
||||
'db_table': 'Movie_rating',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Movie_similarity',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('similarity', models.FloatField(verbose_name='相似度')),
|
||||
('movie_source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movie_source', to='movie.movie')),
|
||||
('movie_target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movie_target', to='movie.movie')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '电影相似度',
|
||||
'verbose_name_plural': '电影相似度',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='movie',
|
||||
name='movie_similarity',
|
||||
field=models.ManyToManyField(through='movie.Movie_similarity', to='movie.movie', verbose_name='相似电影'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='User',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=128, unique=True, verbose_name='用户名')),
|
||||
('password', models.CharField(max_length=256, verbose_name='密码')),
|
||||
('email', models.EmailField(max_length=254, unique=True, verbose_name='邮箱')),
|
||||
('rating_movies', models.ManyToManyField(through='movie.Movie_rating', to='movie.movie')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '用户信息',
|
||||
'verbose_name_plural': '用户信息',
|
||||
'db_table': 'Usser',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='movie_rating',
|
||||
name='user',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movie.user', verbose_name='用户'),
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="shortcut icon" href="{%static'movie/favicon1.ico'%}"/>
|
||||
<link rel="bookmark" href="{%static'movie/favicon1.ico'%}"/>
|
||||
<meta charset="UTF-8">
|
||||
<title>电影推荐系统</title>
|
||||
<script> src="http://cdn.bootcss.com/jquery/11.11.1/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="{%static'bootstrap/css/bootstrap.css'%}">
|
||||
<link rel="sstylesheet" href="/static/bootstrap/js/jquery.min.js">
|
||||
<link rel="stylesheet" href="{%static/bootstrap/js/bootstrap.min.js">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue