Hi, I need help, thanks . My first problem with values: class Servicio(models.Model): .... empresa = models.ForeignKey(Empresa,blank=True,null=True,related_name='servicios_internos') [EMAIL PROTECTED] Trabajadores trabajadores = models.ManyToManyField(Trabajador, blank=True,null=True,related_name='servicios')
when i execute Servicio.objects.all().values('trabajadores') I get the exception: <class 'django.core.exceptions.FieldError'>: Invalid field name: 'trabajadores' why?Django does not use values in relation manytomany? My Second problem with values: class Trabajador(models.Model): [EMAIL PROTECTED] Usuario asociado al trabajador user = models.ForeignKey(User,blank=True, null=False, unique=True,related_name='trabajador') when i execute Trabajador.objects.all().values('user') Django get me a list of user id, but not get me the user objects, why? Can anyone help me? thanks from Spain. -- ------------------------------------------------------------------- Tomás Garzón Hervás Director de Desarrollo y Calidad IACTIVE Intelligent Solutions, S.L. -- Teléfono Móvil: 646760508 -- Bussines & Innovation Center (BIC) Parque tecnológico de ciencias de la salud Avd. de la innovación 1 C.P. 18100 Armilla (Granada) ------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---