Metadata-Version: 1.1
Name: django-children-models-dependencies
Version: 1.1.0
Summary: django-models-dependencies provides tools to get the dependencies in a tree of django models
Home-page: https://github.com/magencydigital/
Author: Stephane "TWidi" Angel
Author-email: s.angel@twidi.com
License: BSD
Description: ===================================
        Django Children Models Dependencies
        ===================================
        
        Purpose
        =======
        
        This is a small app that allow to get the children of a base model, in an dependency order from
        the model with the less dependencies, to the model with the more dependencies, each model coming
        after its own dependencies
        
        For example, for theses models:
        
        .. code-block:: python
        
            class BaseModel(models.Model):
                class Meta:
                    abstract = True
        
            class ChildModel1(BaseModel):
                pass
        
            class ChildModel2(BaseModel):
                link = models.ForeignKey('myapp.ChildModel3', on_delete=models.CASCADE)
        
        
            class ChildModel3(BaseModel):
                pass
        
        
        The order will be:
        
        .. code-block:: python
        
                from django_children_models_dependencies.manager import ChildrenDependenciesManager
        
                self.assertListEqual(ChildrenDependenciesManager.get_children_dependencies(BaseModel), [
                    ChildModel1,  # first model without dependencies
                    ChildModel3,  # dependency of ChildModel2, so it comes before
                    ChildModel2,  # last one, which must come after its own dependencies
                ])
        
        
        Installation
        ============
        
        The ``django-children-models-dependencies`` package is only available on the Magency private pypi
        server.
        
        .. code-block:: sh
        
            pip install -i https://login:password@pypi.magency.ninja/some/index django-children-models-dependencies
        
        
        Developement
        ============
        
        The code can be found on the `Magency mhr-python-external-modules repository
        <https://github.com/magencydigital/mhr-python-external-modules>`_
        
        Install the required packages:
        
        .. code-block:: sh
        
            pip install  -i https://login:password@pypi.magency.ninja/some/index -r requirements-dev.txt
        
        To run tests, simply launch the ``runtests.sh`` script.
        
        And for pylint:
        
        .. code-block:: sh
        
            PYTHONPATH="$PYTHONPATH:." pylint django_children_models_dependencies tests
        
        
        When ready, update the version in ``django_children_models_dependencies/__init__py`` then create
        the package:
        
        .. code-block:: sh
        
            ./setup.py sdist bdist_wheel
        
        You can now upload it to ``devpi``:
        
        .. code-block:: sh
        
            devpi use https://login:password@pypi.magency.ninja
            devpi login yourlogin
            devpi use yourlogin/dev
            devpi upload dist/django_children_models_dependencies-*VERSION*
        
        
        Support
        =======
        
        python>=3.4
        django>=1.9
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
