chartManD commited on
Commit
041b155
·
1 Parent(s): d21ee1b

Se modifican los modelos para elegir etiquetas de la escala

Browse files
tecnicas/migrations/0006_remove_dato_id_calificacion_remove_dato_id_palabra_and_more.py ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by Django 5.2.1 on 2025-07-20 16:18
2
+
3
+ import django.db.models.deletion
4
+ import shortuuid.main
5
+ from django.db import migrations, models
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ ('tecnicas', '0005_alter_esvocabulario_id_vocabulario_and_more'),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.RemoveField(
16
+ model_name='dato',
17
+ name='id_calificacion',
18
+ ),
19
+ migrations.RemoveField(
20
+ model_name='dato',
21
+ name='id_palabra',
22
+ ),
23
+ migrations.RemoveField(
24
+ model_name='valorbooleano',
25
+ name='id_dato',
26
+ ),
27
+ migrations.RemoveField(
28
+ model_name='valordecimal',
29
+ name='id_dato',
30
+ ),
31
+ migrations.RemoveField(
32
+ model_name='orden',
33
+ name='id_catador',
34
+ ),
35
+ migrations.RemoveField(
36
+ model_name='orden',
37
+ name='id_intensidad',
38
+ ),
39
+ migrations.RemoveField(
40
+ model_name='posicion',
41
+ name='id_orden',
42
+ ),
43
+ migrations.RemoveField(
44
+ model_name='posicion',
45
+ name='id_producto',
46
+ ),
47
+ migrations.RemoveField(
48
+ model_name='producto',
49
+ name='id_intensidad',
50
+ ),
51
+ migrations.RemoveField(
52
+ model_name='escala',
53
+ name='etiquetas',
54
+ ),
55
+ migrations.AlterField(
56
+ model_name='sesionsensorial',
57
+ name='codigo_sesion',
58
+ field=models.CharField(default=shortuuid.main.ShortUUID.uuid, editable=False, max_length=22, primary_key=True, serialize=False),
59
+ ),
60
+ migrations.CreateModel(
61
+ name='EtiquetasEscala',
62
+ fields=[
63
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
64
+ ('posicion', models.IntegerField()),
65
+ ('id_escala', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='escalas_etiqutas_escala', to='tecnicas.escala')),
66
+ ('id_etiqueta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='etiqueta_etiquetas_escala', to='tecnicas.etiqueta')),
67
+ ],
68
+ ),
69
+ migrations.DeleteModel(
70
+ name='Calificacion',
71
+ ),
72
+ migrations.DeleteModel(
73
+ name='ValorBooleano',
74
+ ),
75
+ migrations.DeleteModel(
76
+ name='Dato',
77
+ ),
78
+ migrations.DeleteModel(
79
+ name='ValorDecimal',
80
+ ),
81
+ migrations.DeleteModel(
82
+ name='Orden',
83
+ ),
84
+ migrations.DeleteModel(
85
+ name='Posicion',
86
+ ),
87
+ migrations.DeleteModel(
88
+ name='Producto',
89
+ ),
90
+ ]
tecnicas/migrations/0007_alter_sesionsensorial_codigo_sesion_calificacion_and_more.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by Django 5.2.1 on 2025-07-20 16:19
2
+
3
+ import django.db.models.deletion
4
+ import shortuuid.main
5
+ from django.db import migrations, models
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ ('tecnicas', '0006_remove_dato_id_calificacion_remove_dato_id_palabra_and_more'),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.AlterField(
16
+ model_name='sesionsensorial',
17
+ name='codigo_sesion',
18
+ field=models.CharField(default=shortuuid.main.ShortUUID.uuid, editable=False, max_length=22, primary_key=True, serialize=False),
19
+ ),
20
+ migrations.CreateModel(
21
+ name='Calificacion',
22
+ fields=[
23
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
24
+ ('num_repeticion', models.IntegerField()),
25
+ ('id_catador', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_catador', to='tecnicas.catador')),
26
+ ('id_tecnica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_tecnica', to='tecnicas.tecnica')),
27
+ ],
28
+ ),
29
+ migrations.CreateModel(
30
+ name='Dato',
31
+ fields=[
32
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
33
+ ('id_calificacion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dato_calificacion', to='tecnicas.calificacion')),
34
+ ('id_palabra', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dato_palabra', to='tecnicas.palabra')),
35
+ ],
36
+ ),
37
+ migrations.CreateModel(
38
+ name='Orden',
39
+ fields=[
40
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
41
+ ('id_catador', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orden_catador', to='tecnicas.catador')),
42
+ ('id_tecnica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orden_tecnica', to='tecnicas.tecnica')),
43
+ ],
44
+ ),
45
+ migrations.CreateModel(
46
+ name='Producto',
47
+ fields=[
48
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
49
+ ('codigoProducto', models.CharField(max_length=3)),
50
+ ('id_tecnica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='producto_tecnica', to='tecnicas.tecnica')),
51
+ ],
52
+ ),
53
+ migrations.CreateModel(
54
+ name='Posicion',
55
+ fields=[
56
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
57
+ ('posicion', models.IntegerField()),
58
+ ('id_orden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posicion_orden', to='tecnicas.orden')),
59
+ ('id_producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posicion_producto', to='tecnicas.producto')),
60
+ ],
61
+ ),
62
+ migrations.AddField(
63
+ model_name='calificacion',
64
+ name='id_producto',
65
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_producto', to='tecnicas.producto'),
66
+ ),
67
+ migrations.CreateModel(
68
+ name='ValorBooleano',
69
+ fields=[
70
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
71
+ ('valor', models.BooleanField()),
72
+ ('id_dato', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dato_boolean', to='tecnicas.dato')),
73
+ ],
74
+ ),
75
+ migrations.CreateModel(
76
+ name='ValorDecimal',
77
+ fields=[
78
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
79
+ ('valor', models.FloatField()),
80
+ ('id_dato', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dato_decimal', to='tecnicas.dato')),
81
+ ],
82
+ ),
83
+ ]
tecnicas/models/__init__.py CHANGED
@@ -16,6 +16,7 @@ from .es_atributo import EsAtributo
16
  from .sesion_sensorial import SesionSensorial
17
 
18
  from .escala import Escala
 
19
  from .tecnica_intensidad import TecnicaIntensidad
20
  from .producto import Producto
21
 
 
16
  from .sesion_sensorial import SesionSensorial
17
 
18
  from .escala import Escala
19
+ from .etiquetas_escala import EtiquetasEscala
20
  from .tecnica_intensidad import TecnicaIntensidad
21
  from .producto import Producto
22
 
tecnicas/models/calificacion.py CHANGED
@@ -1,11 +1,11 @@
1
  from django.db import models
2
 
3
  from .producto import Producto
4
- from .tecnica_intensidad import TecnicaIntensidad
5
  from .catador import Catador
6
 
7
  class Calificacion(models.Model):
8
  num_repeticion = models.IntegerField()
9
  id_producto = models.ForeignKey(Producto, on_delete=models.CASCADE, related_name="calificacion_producto")
10
- id_intensidad = models.ForeignKey(TecnicaIntensidad, on_delete=models.CASCADE, related_name="calificacion_tec_intensidad")
11
  id_catador = models.ForeignKey(Catador, on_delete=models.CASCADE, related_name="calificacion_catador")
 
1
  from django.db import models
2
 
3
  from .producto import Producto
4
+ from .tecnica import Tecnica
5
  from .catador import Catador
6
 
7
  class Calificacion(models.Model):
8
  num_repeticion = models.IntegerField()
9
  id_producto = models.ForeignKey(Producto, on_delete=models.CASCADE, related_name="calificacion_producto")
10
+ id_tecnica = models.ForeignKey(Tecnica, on_delete=models.CASCADE, related_name="calificacion_tecnica")
11
  id_catador = models.ForeignKey(Catador, on_delete=models.CASCADE, related_name="calificacion_catador")
tecnicas/models/escala.py CHANGED
@@ -6,7 +6,6 @@ from .tipo_escala import TipoEscala
6
  class Escala(models.Model):
7
  id_tipo_escala = models.ForeignKey(TipoEscala, on_delete=models.CASCADE, related_name="escala_tipo_escala")
8
  longitud = models.IntegerField()
9
- etiquetas = models.ManyToManyField(Etiqueta)
10
 
11
  def __str__(self):
12
  return self.longitud
 
6
  class Escala(models.Model):
7
  id_tipo_escala = models.ForeignKey(TipoEscala, on_delete=models.CASCADE, related_name="escala_tipo_escala")
8
  longitud = models.IntegerField()
 
9
 
10
  def __str__(self):
11
  return self.longitud
tecnicas/models/etiquetas_escala.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from django.db import models
2
+
3
+ from .escala import Escala
4
+ from .etiqueta import Etiqueta
5
+
6
+ class EtiquetasEscala(models.Model):
7
+ id_escala = models.ForeignKey(Escala, on_delete=models.CASCADE, related_name="escalas_etiqutas_escala")
8
+ id_etiqueta = models.ForeignKey(Etiqueta, on_delete=models.CASCADE, related_name="etiqueta_etiquetas_escala")
9
+ posicion = models.IntegerField()
tecnicas/models/orden.py CHANGED
@@ -1,11 +1,11 @@
1
  from django.db import models
2
 
3
- from .tecnica_intensidad import TecnicaIntensidad
4
  from .catador import Catador
5
  from .producto import Producto
6
 
7
  class Orden(models.Model):
8
- id_intensidad = models.ForeignKey(TecnicaIntensidad, on_delete=models.CASCADE, related_name="orden_tecnica_intensidad")
9
  id_catador = models.ForeignKey(Catador, on_delete=models.CASCADE, related_name="orden_catador")
10
 
11
  class Posicion(models.Model):
 
1
  from django.db import models
2
 
3
+ from .tecnica import Tecnica
4
  from .catador import Catador
5
  from .producto import Producto
6
 
7
  class Orden(models.Model):
8
+ id_tecnica = models.ForeignKey(Tecnica, on_delete=models.CASCADE, related_name="orden_tecnica")
9
  id_catador = models.ForeignKey(Catador, on_delete=models.CASCADE, related_name="orden_catador")
10
 
11
  class Posicion(models.Model):
tecnicas/models/producto.py CHANGED
@@ -1,10 +1,10 @@
1
  from django.db import models
2
 
3
- from .tecnica_intensidad import TecnicaIntensidad
4
 
5
  class Producto(models.Model):
6
  codigoProducto = models.CharField(max_length=3)
7
- id_intensidad = models.ForeignKey(TecnicaIntensidad, on_delete=models.CASCADE, related_name="producto_tecnica_intensidad")
8
 
9
  def __str__(self):
10
  return self.codigoProducto
 
1
  from django.db import models
2
 
3
+ from .tecnica import Tecnica
4
 
5
  class Producto(models.Model):
6
  codigoProducto = models.CharField(max_length=3)
7
+ id_tecnica = models.ForeignKey(Tecnica, on_delete=models.CASCADE, related_name="producto_tecnica")
8
 
9
  def __str__(self):
10
  return self.codigoProducto