Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/04/2014, 18:11
Avatar de Kristhoff
Kristhoff
 
Fecha de Ingreso: abril-2009
Ubicación: Popayán - Cauca
Mensajes: 550
Antigüedad: 15 años
Puntos: 12
Respuesta: Restricciones sobre ManyToMany

Cita:
Iniciado por razpeitia Ver Mensaje
Cuando usas `through` no te crea ese indice único compuesto como lo haría si no usaras `through`. Tienes que crearlo tu mismo.

Código Python:
Ver original
  1. class Membresia(models.Model):
  2.     persona = models.ForeignKey('Persona')
  3.     grupo = models.ForeignKey('Grupo')
  4.     fechaIngreso = models.DateField(verbose_name='Fecha de ingreso')
  5.  
  6.     class Meta:
  7.         unique_together = ('persona', 'grupo')
^_^ funciona perfecto, gracias!!
__________________
"I need metal in my life, just like an eagle needs to fly..."