Suppression du modèle school

This commit is contained in:
Klafyvel 2018-01-22 14:10:37 +01:00
parent 16bd2a7d66
commit 86e2fbaf77
4 changed files with 4 additions and 61 deletions

View file

@ -1,20 +0,0 @@
# Generated by Django 2.0.1 on 2018-01-20 23:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('content', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Ecole',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
],
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 2.0.1 on 2018-01-20 23:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('content', '0002_ecole'),
]
operations = [
migrations.RenameModel(
old_name='Ecole',
new_name='School',
),
]

View file

@ -10,16 +10,6 @@ class Category(models.Model):
)
class School(models.Model):
"""Une école."""
name = models.CharField(
max_length=255
)
def __str__(self):
return self.name
class Content(models.Model):
"""Un contenu du site (vidéo)."""
name = models.CharField(

View file

@ -1,22 +1,12 @@
from django.db import models
from django.core import validators
from content.models import School, Category, Video
class Voter(models.Model):
name = models.CharField(max_length=100)
firstname = models.CharField(max_length=100)
email = models.EmailField(max_length=200)
ecole = models.ForeignKey('content.School', on_delete=models.CASCADE)
password = models.CharField(max_length=100)
def __str__(self):
return self.firstname + " " + self.name
from content.models import Content
from django.contrib.auth.models import Group, User
class Vote(models.Model):
votant = models.ForeignKey('Voter', on_delete=models.CASCADE)
video = models.ForeignKey('content.Video', on_delete=models.CASCADE)
categorie = models.ForeignKey('content.Category', on_delete=models.CASCADE)
votant = models.ForeignKey(User, on_delete=models.CASCADE)
content = models.ForeignKey(Content, on_delete=models.CASCADE)
vote = models.IntegerField(
validators=[
validators.MaxValueValidator(5),