chartManD commited on
Commit
04266ec
·
1 Parent(s): 6562745

Se agregan nuevos modelos y se actualizan otros

Browse files
.gitignore CHANGED
@@ -166,7 +166,7 @@ dmypy.json
166
  cython_debug/
167
 
168
  # Others files
169
- chu.py
170
 
171
  # PyCharm
172
  # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
 
166
  cython_debug/
167
 
168
  # Others files
169
+ some_test
170
 
171
  # PyCharm
172
  # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
tecnicas/migrations/0003_initial.py ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Generated by Django 5.2.1 on 2025-07-15 16:58
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
+ initial = True
11
+
12
+ dependencies = [
13
+ ('tecnicas', '0002_remove_listapalabra_id_atributos_and_more'),
14
+ ]
15
+
16
+ operations = [
17
+ migrations.CreateModel(
18
+ name='Catador',
19
+ fields=[
20
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21
+ ('usuarioCatador', models.CharField(max_length=255, unique=True)),
22
+ ('nombre', models.CharField(max_length=255)),
23
+ ('apellido', models.CharField(max_length=255)),
24
+ ('telefono', models.BigIntegerField()),
25
+ ('correo', models.EmailField(max_length=254)),
26
+ ('fechaNacimiento', models.DateField()),
27
+ ],
28
+ ),
29
+ migrations.CreateModel(
30
+ name='CategoriaTecnica',
31
+ fields=[
32
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
33
+ ('nombre_categoria', models.CharField(max_length=255, unique=True)),
34
+ ],
35
+ ),
36
+ migrations.CreateModel(
37
+ name='EstiloPalabra',
38
+ fields=[
39
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
40
+ ('nombre_estilo', models.CharField(max_length=255, unique=True)),
41
+ ],
42
+ ),
43
+ migrations.CreateModel(
44
+ name='Etiqueta',
45
+ fields=[
46
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
47
+ ('valor_etiqueta', models.CharField(max_length=255)),
48
+ ],
49
+ ),
50
+ migrations.CreateModel(
51
+ name='Palabra',
52
+ fields=[
53
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
54
+ ('nombre_palabra', models.CharField(max_length=255, unique=True)),
55
+ ],
56
+ ),
57
+ migrations.CreateModel(
58
+ name='Presentador',
59
+ fields=[
60
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
61
+ ('nombre', models.CharField(max_length=255)),
62
+ ('apellido', models.CharField(max_length=255)),
63
+ ('nombre_usuario', models.CharField(max_length=255)),
64
+ ('contrasena', models.CharField(max_length=255)),
65
+ ],
66
+ ),
67
+ migrations.CreateModel(
68
+ name='Producto',
69
+ fields=[
70
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
71
+ ('codigoProducto', models.CharField(max_length=3)),
72
+ ],
73
+ ),
74
+ migrations.CreateModel(
75
+ name='TipoEscala',
76
+ fields=[
77
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
78
+ ('nombre_escala', models.CharField(max_length=255)),
79
+ ],
80
+ ),
81
+ migrations.CreateModel(
82
+ name='Calificacion',
83
+ fields=[
84
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
85
+ ('num_repeticion', models.IntegerField(max_length=3)),
86
+ ('id_catador', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_catador', to='tecnicas.catador')),
87
+ ('id_producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_producto', to='tecnicas.producto')),
88
+ ],
89
+ ),
90
+ migrations.CreateModel(
91
+ name='Escala',
92
+ fields=[
93
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
94
+ ('longitud', models.IntegerField(max_length=3)),
95
+ ('etiquetas', models.ManyToManyField(to='tecnicas.etiqueta')),
96
+ ('id_tipo_escala', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='escala_tipo_escala', to='tecnicas.tipoescala')),
97
+ ],
98
+ ),
99
+ migrations.CreateModel(
100
+ name='Orden',
101
+ fields=[
102
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
103
+ ('id_catador', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orden_catador', to='tecnicas.catador')),
104
+ ],
105
+ ),
106
+ migrations.CreateModel(
107
+ name='Dato',
108
+ fields=[
109
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
110
+ ('id_calificacion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dato_calificacion', to='tecnicas.calificacion')),
111
+ ('id_palabra', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dato_palabra', to='tecnicas.palabra')),
112
+ ],
113
+ ),
114
+ migrations.CreateModel(
115
+ name='Posicion',
116
+ fields=[
117
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
118
+ ('posicion', models.IntegerField(max_length=2)),
119
+ ('id_orden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posicion_orden', to='tecnicas.orden')),
120
+ ('id_producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posicion_producto', to='tecnicas.producto')),
121
+ ],
122
+ ),
123
+ migrations.CreateModel(
124
+ name='Tecnica',
125
+ fields=[
126
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
127
+ ('repeticiones_max', models.IntegerField(default=0)),
128
+ ('repecion', models.IntegerField(default=0)),
129
+ ('limite_catadores', models.IntegerField()),
130
+ ('instrucciones', models.CharField(max_length=255)),
131
+ ('id_estilo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='estilo_tecnica', to='tecnicas.estilopalabra')),
132
+ ],
133
+ ),
134
+ migrations.CreateModel(
135
+ name='SesionSensorial',
136
+ fields=[
137
+ ('codigo_sesion', models.CharField(default=shortuuid.main.ShortUUID.uuid, editable=False, max_length=22, primary_key=True, serialize=False)),
138
+ ('nombre_sesion', models.CharField(max_length=255, null=True)),
139
+ ('fechaCreacion', models.DateTimeField(verbose_name='date published')),
140
+ ('activo', models.BooleanField(default=False)),
141
+ ('creadoPor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='presentador_sesion', to='tecnicas.presentador')),
142
+ ('tecnica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sesion_tecnica', to='tecnicas.tecnica')),
143
+ ],
144
+ ),
145
+ migrations.CreateModel(
146
+ name='EsAtributo',
147
+ fields=[
148
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
149
+ ('palabras', models.ManyToManyField(related_name='estilo_atributo_palabras', to='tecnicas.palabra')),
150
+ ('id_tecnica', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='tecnica_esatributo', to='tecnicas.tecnica')),
151
+ ],
152
+ ),
153
+ migrations.CreateModel(
154
+ name='TecnicaIntensidad',
155
+ fields=[
156
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
157
+ ('id_escala', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='escala_intensidad', to='tecnicas.escala')),
158
+ ('id_tecnica', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='tecnica_intensidad', to='tecnicas.tecnica')),
159
+ ],
160
+ ),
161
+ migrations.AddField(
162
+ model_name='producto',
163
+ name='id_intensidad',
164
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='producto_tecnica_intensidad', to='tecnicas.tecnicaintensidad'),
165
+ ),
166
+ migrations.AddField(
167
+ model_name='orden',
168
+ name='id_intensidad',
169
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orden_tecnica_intensidad', to='tecnicas.tecnicaintensidad'),
170
+ ),
171
+ migrations.AddField(
172
+ model_name='calificacion',
173
+ name='id_intensidad',
174
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calificacion_tec_intensidad', to='tecnicas.tecnicaintensidad'),
175
+ ),
176
+ migrations.CreateModel(
177
+ name='TipoTecnica',
178
+ fields=[
179
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
180
+ ('nombre_tecnica', models.CharField(max_length=255)),
181
+ ('id_categoria_tecnica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tipo_tecnica_categoria_tecnica', to='tecnicas.categoriatecnica')),
182
+ ],
183
+ ),
184
+ migrations.AddField(
185
+ model_name='tecnica',
186
+ name='tipo_tecnica',
187
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tecnica_tipo_tecnica', to='tecnicas.tipotecnica'),
188
+ ),
189
+ migrations.CreateModel(
190
+ name='ValorBooleano',
191
+ fields=[
192
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
193
+ ('valor', models.BooleanField()),
194
+ ('id_dato', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dato_boolean', to='tecnicas.dato')),
195
+ ],
196
+ ),
197
+ migrations.CreateModel(
198
+ name='ValorDecimal',
199
+ fields=[
200
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
201
+ ('valor', models.FloatField()),
202
+ ('id_dato', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dato_decimal', to='tecnicas.dato')),
203
+ ],
204
+ ),
205
+ migrations.CreateModel(
206
+ name='Vocabulario',
207
+ fields=[
208
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
209
+ ('nomre_vocabulario', models.CharField(max_length=255, unique=True)),
210
+ ('palabras', models.ManyToManyField(related_name='vovabulario_palabras', to='tecnicas.palabra')),
211
+ ],
212
+ ),
213
+ migrations.CreateModel(
214
+ name='EsVocabulario',
215
+ fields=[
216
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
217
+ ('id_tecnica', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='tecnica_esvacabulario', to='tecnicas.tecnica')),
218
+ ('id_vocabulario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vocabulario_esvocabulario', to='tecnicas.vocabulario')),
219
+ ],
220
+ ),
221
+ ]
tecnicas/models/__init__.py CHANGED
@@ -1,15 +1,28 @@
1
- # from .presentador import Presentador
2
- # from .palabra import Palabra
3
- # from .vocabulario import Vocabulario
4
- # from .estilo_palabra import EstiloPalabra
5
- # from .es_atributo import EsAtributo
6
- # from .lista_palabra import ListaPalabra
7
- # from .es_vocabulario import EsVocabulario
8
- # from .tipo_tecnica import TipoTecnica
9
- # from .tecnica import Tecnica
10
- # from .sesion_sensorial import SesionSensorial
11
-
12
- # from .producto import Producto
13
- # from .etiqueta import Etiqueta
14
- # from .tipo_escala import TipoEscala
15
- # from .escala import Escala
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from .categoria_tecnica import CategoriaTecnica
2
+ from .etiqueta import Etiqueta
3
+ from .tipo_escala import TipoEscala
4
+ from .tipo_tecnica import TipoTecnica
5
+ from .estilo_palabra import EstiloPalabra
6
+
7
+ from .presentador import Presentador
8
+ from .catador import Catador
9
+
10
+ from .palabra import Palabra
11
+ from .vocabulario import Vocabulario
12
+
13
+ from .tecnica import Tecnica
14
+ from .es_vocabulario import EsVocabulario
15
+ 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
+
22
+ from .calificacion import Calificacion
23
+ from .dato import Dato
24
+ from .dato_valor import ValorDecimal
25
+ from .dato_valor import ValorBooleano
26
+
27
+ from .orden import Orden
28
+ from .orden import Posicion
tecnicas/models/calificacion.py ADDED
@@ -0,0 +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(max_length=3)
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")
tecnicas/models/catador.py CHANGED
@@ -1,8 +1,12 @@
1
  from django.db import models
2
 
3
- class Catador():
4
  usuarioCatador = models.CharField(max_length=255, unique=True)
5
  nombre = models.CharField(max_length=255)
6
  apellido = models.CharField(max_length=255)
7
  telefono = models.BigIntegerField()
8
- correo = models.EmailField()
 
 
 
 
 
1
  from django.db import models
2
 
3
+ class Catador(models.Model):
4
  usuarioCatador = models.CharField(max_length=255, unique=True)
5
  nombre = models.CharField(max_length=255)
6
  apellido = models.CharField(max_length=255)
7
  telefono = models.BigIntegerField()
8
+ correo = models.EmailField()
9
+ fechaNacimiento = models.DateField()
10
+
11
+ def __str__(self):
12
+ return self.usuarioCatador
tecnicas/models/categoria_tecnica.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from django.db import models
2
+
3
+ class CategoriaTecnica(models.Model):
4
+ nombre_categoria = models.CharField(max_length=255, unique=True)
5
+
6
+ def __str__(self):
7
+ return self.nombre_categoria
tecnicas/models/{lista_palabra.py → dato.py} RENAMED
@@ -1,8 +1,8 @@
1
  from django.db import models
2
 
3
  from .palabra import Palabra
4
- from .es_atributo import EsAtributo
5
 
6
- class ListaPalabra(models.Model):
7
- id_palabra = models.ForeignKey(Palabra, on_delete=models.CASCADE, related_name="palabra_listapalabras")
8
- id_atributos = models.ForeignKey(EsAtributo, on_delete=models.CASCADE, related_name="atributo_listapalabras")
 
1
  from django.db import models
2
 
3
  from .palabra import Palabra
4
+ from .calificacion import Calificacion
5
 
6
+ class Dato(models.Model):
7
+ id_palabra = models.ForeignKey(Palabra, on_delete=models.CASCADE, related_name="dato_palabra")
8
+ id_calificacion = models.ForeignKey(Calificacion, on_delete=models.CASCADE, related_name="dato_calificacion")
tecnicas/models/dato_valor.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from django.db import models
2
+
3
+ from .dato import Dato
4
+
5
+ class ValorDecimal(models.Model):
6
+ id_dato = models.OneToOneField(Dato, on_delete=models.CASCADE, related_name="dato_decimal")
7
+ valor = models.FloatField()
8
+
9
+ def __str__(self):
10
+ return self.valor
11
+
12
+ class ValorBooleano(models.Model):
13
+ id_dato = models.OneToOneField(Dato, on_delete=models.CASCADE, related_name="dato_boolean")
14
+ valor = models.BooleanField()
15
+
16
+ def __str__(self):
17
+ return self.valor
tecnicas/models/es_atributo.py CHANGED
@@ -1,6 +1,8 @@
1
  from django.db import models
2
 
3
- from .estilo_palabra import EstiloPalabra
 
4
 
5
  class EsAtributo(models.Model):
6
- id_estilo = models.ForeignKey(EstiloPalabra, on_delete=models.CASCADE, related_name="estilo_esatributo")
 
 
1
  from django.db import models
2
 
3
+ from .tecnica import Tecnica
4
+ from .palabra import Palabra
5
 
6
  class EsAtributo(models.Model):
7
+ id_tecnica = models.OneToOneField(Tecnica, on_delete=models.CASCADE, related_name="tecnica_esatributo")
8
+ palabras = models.ManyToManyField(Palabra, related_name="estilo_atributo_palabras")
tecnicas/models/es_vocabulario.py CHANGED
@@ -1,8 +1,8 @@
1
  from django.db import models
2
 
3
- from .estilo_palabra import EstiloPalabra
4
  from .vocabulario import Vocabulario
5
 
6
  class EsVocabulario(models.Model):
7
- id_estilo = models.ForeignKey(EstiloPalabra, on_delete=models.CASCADE, related_name="estilo_esvacabulario")
8
  id_vocabulario = models.ForeignKey(Vocabulario, on_delete=models.CASCADE, related_name="vocabulario_esvocabulario")
 
1
  from django.db import models
2
 
3
+ from .tecnica import Tecnica
4
  from .vocabulario import Vocabulario
5
 
6
  class EsVocabulario(models.Model):
7
+ id_tecnica = models.OneToOneField(Tecnica, on_delete=models.CASCADE, related_name="tecnica_esvacabulario")
8
  id_vocabulario = models.ForeignKey(Vocabulario, on_delete=models.CASCADE, related_name="vocabulario_esvocabulario")
tecnicas/models/escala.py CHANGED
@@ -4,8 +4,8 @@ from .etiqueta import Etiqueta
4
  from .tipo_escala import TipoEscala
5
 
6
  class Escala(models.Model):
7
- longitud = models.IntegerField()
8
- id_tipo_escala = models.ForeignKey(TipoEscala)
9
  etiquetas = models.ManyToManyField(Etiqueta)
10
 
11
  def __str__(self):
 
4
  from .tipo_escala import TipoEscala
5
 
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(max_length=3)
9
  etiquetas = models.ManyToManyField(Etiqueta)
10
 
11
  def __str__(self):
tecnicas/models/orden.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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):
12
+ id_producto = models.ForeignKey(Producto, on_delete=models.CASCADE, related_name="posicion_producto")
13
+ id_orden = models.ForeignKey(Orden, on_delete=models.CASCADE, related_name="posicion_orden")
14
+ posicion = models.IntegerField(max_length=2)
tecnicas/models/producto.py CHANGED
@@ -1,10 +1,10 @@
1
  from django.db import models
2
 
3
- from .sesion_sensorial import SesionSensorial
4
 
5
  class Producto(models.Model):
6
  codigoProducto = models.CharField(max_length=3)
7
- id_sesion = models.ForeignKey(SesionSensorial, on_delete=models.CASCADE, related_name="productos_sesion")
8
 
9
  def __str__(self):
10
  return self.codigoProducto
 
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
tecnicas/models/sesion_sensorial.py CHANGED
@@ -1,10 +1,16 @@
 
1
  from django.db import models
2
 
3
  from .presentador import Presentador
4
  from .tecnica import Tecnica
5
 
6
  class SesionSensorial(models.Model):
 
 
7
  fechaCreacion = models.DateTimeField("date published")
8
  activo = models.BooleanField(default=False)
9
  creadoPor = models.ForeignKey(Presentador, on_delete=models.CASCADE, related_name="presentador_sesion")
10
- tecnica = models.ForeignKey(Tecnica, on_delete=models.CASCADE, related_name="sesion_tecnica")
 
 
 
 
1
+ import shortuuid
2
  from django.db import models
3
 
4
  from .presentador import Presentador
5
  from .tecnica import Tecnica
6
 
7
  class SesionSensorial(models.Model):
8
+ codigo_sesion = models.CharField(primary_key=True, default=shortuuid.uuid, editable=False, max_length=22)
9
+ nombre_sesion = models.CharField(max_length=255, null=True)
10
  fechaCreacion = models.DateTimeField("date published")
11
  activo = models.BooleanField(default=False)
12
  creadoPor = models.ForeignKey(Presentador, on_delete=models.CASCADE, related_name="presentador_sesion")
13
+ tecnica = models.ForeignKey(Tecnica, on_delete=models.CASCADE, related_name="sesion_tecnica")
14
+
15
+ def __str__(self):
16
+ return self.codigo_sesion
tecnicas/models/tecnica.py CHANGED
@@ -5,7 +5,7 @@ from .tipo_tecnica import TipoTecnica
5
 
6
  class Tecnica(models.Model):
7
  tipo_tecnica = models.ForeignKey(TipoTecnica, on_delete=models.CASCADE, related_name="tecnica_tipo_tecnica")
8
- maximas_repeticiones = models.IntegerField(default=0)
9
  repecion = models.IntegerField(default=0)
10
  limite_catadores = models.IntegerField()
11
  instrucciones = models.CharField(max_length=255)
 
5
 
6
  class Tecnica(models.Model):
7
  tipo_tecnica = models.ForeignKey(TipoTecnica, on_delete=models.CASCADE, related_name="tecnica_tipo_tecnica")
8
+ repeticiones_max = models.IntegerField(default=0)
9
  repecion = models.IntegerField(default=0)
10
  limite_catadores = models.IntegerField()
11
  instrucciones = models.CharField(max_length=255)
tecnicas/models/tecnica_intensidad.py CHANGED
@@ -1,6 +1,8 @@
1
  from django.db import models
2
 
3
  from .escala import Escala
 
4
 
5
  class TecnicaIntensidad(models.Model):
6
- id_escala = models.ForeignKey(Escala)
 
 
1
  from django.db import models
2
 
3
  from .escala import Escala
4
+ from .tecnica import Tecnica
5
 
6
  class TecnicaIntensidad(models.Model):
7
+ id_tecnica = models.OneToOneField(Tecnica, on_delete=models.CASCADE, related_name="tecnica_intensidad")
8
+ id_escala = models.OneToOneField(Escala, on_delete=models.CASCADE, related_name="escala_intensidad")
tecnicas/models/tipo_escala.py CHANGED
@@ -1,6 +1,6 @@
1
  from django.db import models
2
 
3
- class TipoEscala():
4
  nombre_escala = models.CharField(max_length=255)
5
 
6
  def __str__(self):
 
1
  from django.db import models
2
 
3
+ class TipoEscala(models.Model):
4
  nombre_escala = models.CharField(max_length=255)
5
 
6
  def __str__(self):
tecnicas/models/tipo_tecnica.py CHANGED
@@ -1,7 +1,10 @@
1
  from django.db import models
2
 
 
 
3
  class TipoTecnica(models.Model):
4
  nombre_tecnica = models.CharField(max_length=255)
 
5
 
6
  def __str__(self):
7
  return self.nombre_tecnica
 
1
  from django.db import models
2
 
3
+ from .categoria_tecnica import CategoriaTecnica
4
+
5
  class TipoTecnica(models.Model):
6
  nombre_tecnica = models.CharField(max_length=255)
7
+ id_categoria_tecnica = models.ForeignKey(CategoriaTecnica, on_delete=models.CASCADE, related_name="tipo_tecnica_categoria_tecnica")
8
 
9
  def __str__(self):
10
  return self.nombre_tecnica
tecnicas/models/vocabulario.py CHANGED
@@ -4,7 +4,7 @@ from .palabra import Palabra
4
 
5
  class Vocabulario(models.Model):
6
  nomre_vocabulario = models.CharField(max_length=255, unique=True)
7
- palabras = models.ManyToManyField(Palabra)
8
 
9
  def __str__(self):
10
  return self.nomre_vocabulario
 
4
 
5
  class Vocabulario(models.Model):
6
  nomre_vocabulario = models.CharField(max_length=255, unique=True)
7
+ palabras = models.ManyToManyField(Palabra, related_name="vovabulario_palabras")
8
 
9
  def __str__(self):
10
  return self.nomre_vocabulario