FerdinandPyCode commited on
Commit
61327a7
·
1 Parent(s): 394de27

models redisigned

Browse files
db.sqlite3 CHANGED
Binary files a/db.sqlite3 and b/db.sqlite3 differ
 
formations/__pycache__/models.cpython-310.pyc CHANGED
Binary files a/formations/__pycache__/models.cpython-310.pyc and b/formations/__pycache__/models.cpython-310.pyc differ
 
formations/migrations/0002_formation_langue_formation_langue_dub_and_more.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by Django 4.2.5 on 2024-03-23 15:53
2
+
3
+ from django.db import migrations, models
4
+ import django.db.models.deletion
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ('formations', '0001_initial'),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AddField(
15
+ model_name='formation',
16
+ name='langue',
17
+ field=models.CharField(default='exit', max_length=1024),
18
+ preserve_default=False,
19
+ ),
20
+ migrations.AddField(
21
+ model_name='formation',
22
+ name='langue_dub',
23
+ field=models.CharField(default='', max_length=1024),
24
+ preserve_default=False,
25
+ ),
26
+ migrations.AddField(
27
+ model_name='formation',
28
+ name='langue_subtitles',
29
+ field=models.CharField(default='', max_length=1024),
30
+ preserve_default=False,
31
+ ),
32
+ migrations.AddField(
33
+ model_name='formation',
34
+ name='level',
35
+ field=models.CharField(default='', max_length=1024),
36
+ preserve_default=False,
37
+ ),
38
+ migrations.AddField(
39
+ model_name='paiementuser',
40
+ name='montant',
41
+ field=models.DecimalField(decimal_places=3, max_digits=15, null=True),
42
+ ),
43
+ migrations.CreateModel(
44
+ name='RessourceCours',
45
+ fields=[
46
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
47
+ ('titre', models.CharField(max_length=1024)),
48
+ ('description', models.CharField(max_length=1024)),
49
+ ('type_ressource', models.CharField(choices=[('Dubbing', 'Dubbing'), ('Subtitle', 'Subtitle')], default=('Dubbing', 'Dubbing'), max_length=1024)),
50
+ ('updated_at', models.DateTimeField(auto_now=True)),
51
+ ('created_at', models.DateTimeField(auto_now_add=True)),
52
+ ('video_link', models.FileField(max_length=1024, upload_to='')),
53
+ ('cour', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='formations.cours')),
54
+ ],
55
+ ),
56
+ ]
formations/migrations/0003_rename_video_link_ressourcecours_file_link.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by Django 4.2.5 on 2024-03-23 19:08
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('formations', '0002_formation_langue_formation_langue_dub_and_more'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameField(
14
+ model_name='ressourcecours',
15
+ old_name='video_link',
16
+ new_name='file_link',
17
+ ),
18
+ ]
formations/migrations/__pycache__/0002_formation_langue_formation_langue_dub_and_more.cpython-310.pyc ADDED
Binary file (1.61 kB). View file
 
formations/migrations/__pycache__/0003_rename_video_link_ressourcecours_file_link.cpython-310.pyc ADDED
Binary file (651 Bytes). View file
 
formations/models.py CHANGED
@@ -17,6 +17,10 @@ class Formation(models.Model):
17
  titre = models.CharField(max_length=255)
18
  image = models.FileField(max_length=1024)
19
  prerequis = models.CharField(max_length=1024)
 
 
 
 
20
  author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
21
  montant = models.DecimalField(default=0, max_digits=16, decimal_places= 2)
22
  categorie = models.ForeignKey(CategorieFormation, on_delete=models.SET_NULL, null=True)
@@ -41,7 +45,6 @@ class Cours(models.Model):
41
  created_at = models.DateTimeField(auto_now_add=True)
42
  updated_at = models.DateTimeField(auto_now = True)
43
 
44
- # --------------------
45
 
46
  class ArchiveFormation(models.Model):
47
 
@@ -83,6 +86,20 @@ class PaiementUser(models.Model):
83
 
84
  user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
85
  formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True)
 
86
  created_at = models.DateTimeField(auto_now_add=True)
87
  updated_at = models.DateTimeField(auto_now = True)
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  titre = models.CharField(max_length=255)
18
  image = models.FileField(max_length=1024)
19
  prerequis = models.CharField(max_length=1024)
20
+ level = models.CharField(max_length=1024)
21
+ langue = models.CharField(max_length=1024)
22
+ langue_dub = models.CharField(max_length=1024)
23
+ langue_subtitles = models.CharField(max_length=1024)
24
  author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
25
  montant = models.DecimalField(default=0, max_digits=16, decimal_places= 2)
26
  categorie = models.ForeignKey(CategorieFormation, on_delete=models.SET_NULL, null=True)
 
45
  created_at = models.DateTimeField(auto_now_add=True)
46
  updated_at = models.DateTimeField(auto_now = True)
47
 
 
48
 
49
  class ArchiveFormation(models.Model):
50
 
 
86
 
87
  user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
88
  formation = models.ForeignKey(Formation, on_delete=models.SET_NULL, null=True)
89
+ montant = models.DecimalField(decimal_places = 3, null = True, max_digits = 15)
90
  created_at = models.DateTimeField(auto_now_add=True)
91
  updated_at = models.DateTimeField(auto_now = True)
92
 
93
+ class RessourceCours(models.Model):
94
+
95
+ RESSOURCE_CHOICES = (
96
+ ('Dubbing', 'Dubbing'),
97
+ ('Subtitle', 'Subtitle')
98
+ )
99
+ cour = models.ForeignKey(Cours, on_delete=models.SET_NULL, null=True)
100
+ titre = models.CharField(max_length=1024)
101
+ description = models.CharField(max_length=1024)
102
+ type_ressource = models.CharField(max_length=1024, choices=RESSOURCE_CHOICES, default=('Dubbing', 'Dubbing'))
103
+ updated_at = models.DateTimeField(auto_now = True)
104
+ created_at = models.DateTimeField(auto_now_add=True)
105
+ file_link = models.FileField(max_length=1024)