These are chat archives for django/django
I already installed packages, but python is still giving me error message regarding not installed packages something :
ModuleNotFoundError: No module named 'requests'
Can anyone please help me to resolve this issue?
Hy All, I'm using django with Django graphene to provide a graphQl server to my frontend witch is a create-react-app with apollo.and apollo-link-state Everything is good and nice until ....
Aparently the type defenintion isn't compatible with / can't handle a many to many through object.
Has anyone advise, had this issue ?
Here is my case
class Question(models.Model): name = models.CharField(max_length=50, default="Default_name") text = models.CharField(max_length=50, default="Question text ...") def __str__(self): return self.name class Formo(models.Model): name = models.CharField(max_length=50) entity = models.ForeignKey(Entity, on_delete=models.CASCADE) question_set = models.ManyToManyField('Question', through='FormoQuestion') def __str__(self): return self.name class FormoQuestion(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) formo = models.ForeignKey(Formo, on_delete=models.CASCADE) number = models.PositiveIntegerField() def __str__(self): return '%s_%s_%i' % (self.formo, self.question, self.number) class Meta: ordering = ('number',)
So i can't get The QuestionSet to work this way.
Is it possible to handle many to many fields differently ?