Skip to content

Prefetch Account model for User #340

@maxifom

Description

@maxifom

Is your feature request related to a problem? Please describe.
I got a list of 100 models, each connected to django User model. For each model I get a DB request to accounts table to select it.

Describe the solution you'd like
Something like prefetch_related working in django. I want something like in User model get_queryset:
qs = qs.prefetch_related('account')
As I found out this function triggers DB request:

account.context_processors.account -> Account.for_request

which just uses Account.get().

Additional context
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions