Spaces:
Sleeping
Sleeping
from django.db import models | |
# Create your models here. | |
from authentication.models import User | |
class CategorieFormation(models.Model): | |
titre = models.CharField(max_length=255) | |
tag = models.CharField(max_length=255) | |
icone = models.CharField(max_length=255) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class Formation(models.Model): | |
description = models.CharField(max_length=1024) | |
titre = models.CharField(max_length=255) | |
image = models.FileField(max_length=1024) | |
prerequis = models.CharField(max_length=1024) | |
level = models.CharField(max_length=1024) | |
langue = models.CharField(max_length=1024) | |
langue_dub = models.CharField(max_length=1024) | |
langue_subtitles = models.CharField(max_length=1024) | |
author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
montant = models.DecimalField(default=0, max_digits=16, decimal_places= 2) | |
categorie = models.ForeignKey(CategorieFormation, on_delete=models.SET_NULL, null=True,related_name='formations') | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class UserFormation(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class Cours(models.Model): | |
titre = models.CharField(max_length=255) | |
duree = models.IntegerField() | |
video = models.FileField(max_length=1024) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class ArchiveFormation(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class ListSouhaitFormation(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class FavorisFormation(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class PanierUser(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class AvisFormation(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class PaiementUser(models.Model): | |
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) | |
formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True) | |
montant = models.DecimalField(decimal_places = 3, null = True, max_digits = 15) | |
created_at = models.DateTimeField(auto_now_add=True) | |
updated_at = models.DateTimeField(auto_now = True) | |
class RessourceCours(models.Model): | |
RESSOURCE_CHOICES = ( | |
('Dubbing', 'Dubbing'), | |
('Subtitle', 'Subtitle') | |
) | |
cour = models.ForeignKey(Cours, on_delete=models.SET_NULL, null=True) | |
titre = models.CharField(max_length=1024) | |
description = models.CharField(max_length=1024) | |
type_ressource = models.CharField(max_length=1024, choices=RESSOURCE_CHOICES, default=('Dubbing', 'Dubbing')) | |
updated_at = models.DateTimeField(auto_now = True) | |
created_at = models.DateTimeField(auto_now_add=True) | |
file_link = models.FileField(max_length=1024) |