I have a model say:
class Abc(models.model):
....
.....
Now When performing query(let go all the imports):
print(Abc.objects.all())
I am getting multiple lists of querySet:
Output as
<QuerySet [<Abc: ...>, <Abc: .....> , .....]>
<QuerySet [<Abc: ...>, <Abc: .....> , .....]>
I have to User so I am getting 2 different QuerySet. How can I get all the user's querySet in single list,
Wanted output as:
<QuerySet [<Abc: ...>, <Abc: .....> , .....]>, <QuerySet [<Abc: ...>, <Abc: .....> , .....]> or in a single list
<QuerySet [<Abc: ...>, <Abc: .....> , .....]>
But from my knowledge a model should list all the querySet in a single list, why am I getting multiple lists? Image of my model and error
print(Abc.objects.all())will print the only single queryset. In your case, there may be a chance for you may be calling it twice. You can verify that by calling it from Django Shell