Skip to main content

Django Fast Generic Foreign Keys

Travis

Travis

Overview

Generic foreign keys are incredibly powerful but can’t be prefetched, leading to a large number of SQL queries when accessing a generic foreign key field while iterating over a queryset. This app provides a function that reduces the number of SQL queries to 1 + (number of content types included in the set of generic foreign keys).

Installation

  1. Install or add django-fast-gfk to your Python path.

Usage

The fetch function returns a generator with the generic foreign key prefetched. Parameter field is the name of the generic foreign key.:

from fast_gfk import fetch

fetch(Bar.objects.all(), field="target"))

Authors

  • Hedley Roos

Changelog

0.1

  1. Initial release.

Release files for django-fast-gfk 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-fast-gfk 0.1
File Size Uploaded
django-fast-gfk-0.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-fast-gfk 0.1
File Interpreter ABI Platform
django_fast_gfk-0.1-py2.7.egg Legacy Egg format - - Details

Total release size:14.1 kB

Release files / django-fast-gfk-0.1.tar.gz

Download URL django-fast-gfk-0.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
02bb720890527738d4f97950f8cd5196d8bc6e2fb3b7a99bf80e039998bba3a0
BLAKE2b-256 checksum
How to use checksums
1c504d26a1b876010ffef95396aa2a67dc26d7a0add895f06769c84f3c057c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_fast_gfk-0.1-py2.7.egg

Download URL django_fast_gfk-0.1-py2.7.egg
Size 9.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
fec7f550170c8923fa1a779ddfa3fbe1b058a9dce066bc0d668fabdc21902ff3
BLAKE2b-256 checksum
How to use checksums
c0038fd103706b416981e3db0e1f5e2c551572897bdc933726bc471203fe21f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page