Metadata-Version: 1.1
Name: django-prefetch-utils
Version: 0.1.0
Summary: An library of utilities and enhancements for Django's prefetch_related system.
Home-page: https://github.com/roverdotcom/django-prefetch-utils
Author: Mike Hansen
Author-email: mike@rover.com
License: BSD 3-Clause License
Description-Content-Type: UNKNOWN
Description: ========
        Overview
        ========
        
        
        
        This library currently provides a replacement implementation of
        ``prefetch_related_objects`` which uses an `identity map
        <https://en.wikipedia.org/wiki/Identity_map_pattern>`_ to
        automatically reduce the number of queries performed when prefetching.
        
        For example, considered the following data model::
        
           class Toy(models.Model):
               dog = models.ForeignKey('dogs.Dog')
        
           class Dog(models.Model):
               name = models.CharField()
               favorite_toy = models.ForeignKey('toys.Toy', null=True)
        
        
        With this library, we get don't need to do a database query to
        perform the prefetch for ``favorite_toy`` since that object
        had already been fetched as part of the prefetching for ``toy_set``::
        
           >>> dog = Dog.objects.prefetch_related('toys', 'favorite_toy')[0]
           SELECT * from dogs_dog limit 1;
           SELECT * FROM toys_toy where toys_toy.dog_id IN (1);
           >>> dog.favorite_toy is dog.toy_set.all()[0]  # no queries done
           True
        
        
        The plan is to increase the scope of the library in future versions to
        provide additional tools for working with ``prefetch_related``.
        
        
        * Free software: BSD 3-Clause License
        
        Installation
        ============
        
        ::
        
            pip install django-prefetch-utils
        
        Documentation
        =============
        
        
        https://django-prefetch-utils.readthedocs.io/
        
        Changelog
        =========
        
        0.1.0 (2019-07-16)
        ------------------
        
        * First release on PyPI.
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
