[Python] how to loop through django queryset data and set the values in an array not a...

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    I Have to loop through data of the query set in django and put the data into an array without specifying the model name.

    My Django view:

    permissions = Permission.objects.all().order_by('perm_label')
    arrayData = []
    for type in permissions:
    for value in type:
    arrayData.append(value)


    This is giving me error:

    Permission' object is not iterable

    Continue reading...

Compartilhe esta Página