Initial
This commit is contained in:
commit
e9b41dadab
30 files changed
+398
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Generated by Django 3.0.6 on 2020-05-28 10:13
|
||||
|
||||
from django.conf import settings
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Movie',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=32)),
|
||||
('description', models.TextField(max_length=360)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Rating',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('stars', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])),
|
||||
('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Movie')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('user', 'movie')},
|
||||
'index_together': {('user', 'movie')},
|
||||
},
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user