These are chat archives for django/django

Feb 2019
Feb 04 04:40

I already installed packages, but python is still giving me error message regarding not installed packages something :

import requests
ModuleNotFoundError: No module named 'requests'

Can anyone please help me to resolve this issue?

Mohammad Zaman
Feb 04 07:13
@sahil-developer-88 is this about incoming HTTP requests?
Feb 04 07:19
@mzaman07 the issue was resolved, i went into python.exe folder and installed packages there, then i run my project, so, the modules giving notfounderror error got resolved now.
Mohammad Zaman
Feb 04 07:20
ok I see
that's good
Feb 04 07:22
@mzaman07 thanks for your support
Feb 04 11:26

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):

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):

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 ?