{"id":18763770,"url":"https://github.com/roverdotcom/django-related-models","last_synced_at":"2025-12-06T05:30:16.994Z","repository":{"id":32972818,"uuid":"147821778","full_name":"roverdotcom/django-related-models","owner":"roverdotcom","description":"An easy way to fetch all the related objects of a Django model's instance.","archived":false,"fork":false,"pushed_at":"2022-01-03T21:33:47.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-01-30T09:47:33.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roverdotcom.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-07T12:41:23.000Z","updated_at":"2022-01-03T21:33:51.000Z","dependencies_parsed_at":"2022-08-07T19:15:36.497Z","dependency_job_id":null,"html_url":"https://github.com/roverdotcom/django-related-models","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-related-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-related-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-related-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roverdotcom%2Fdjango-related-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roverdotcom","download_url":"https://codeload.github.com/roverdotcom/django-related-models/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239661868,"owners_count":19676411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T18:27:24.167Z","updated_at":"2025-12-06T05:30:16.648Z","avatar_url":"https://github.com/roverdotcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"========\nOverview\n========\n\n.. start-badges\n\n.. list-table::\n    :stub-columns: 1\n\n    * - docs\n      - |docs|\n    * - tests\n        | |github-tests|\n        | |codecov|\n    * - package\n      - | |version| |wheel| |supported-versions| |supported-implementations|\n        | |commits-since|\n\n\n.. |docs| image:: https://readthedocs.org/projects/django-related-models/badge/?version=latest\n    :target: https://django-related-models.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. |codecov| image:: https://codecov.io/github/roverdotcom/django-related-models/coverage.svg?branch=master\n    :alt: Coverage Status\n    :target: https://codecov.io/github/roverdotcom/django-related-models\n\n.. |version| image:: https://img.shields.io/pypi/v/django-related-models.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.python.org/pypi/django-related-models\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/roverdotcom/django-related-models/v0.1.1.svg\n    :alt: Commits since latest release\n    :target: https://github.com/roverdotcom/django-related-models/compare/v0.1.1...master\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/django-related-models.svg\n    :alt: PyPI Wheel\n    :target: https://pypi.python.org/pypi/django-related-models\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/django-related-models.svg\n    :alt: Supported versions\n    :target: https://pypi.python.org/pypi/django-related-models\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/django-related-models.svg\n    :alt: Supported implementations\n    :target: https://pypi.python.org/pypi/django-related-models\n\n.. |github-tests| image:: https://github.com/roverdotcom/django-related-models/actions/workflows/build/badge.svg\n    :alt: GitHub build status\n    :target: https://github.com/roverdotcom/django-related-models/\n\n.. end-badges\n\nA library designed such that, when provided with a model instance it will return a QuerySet for the rows that are\nassociated with that model instance. It also works well with ``GenericForeignKey`` objects.\n\n.. code:: python\n\n    \u003e\u003e\u003e eminem = Artist.objects.filter(stage_name='Eminem').first()\n    \u003e\u003e\u003e list(get_related_objects(eminem))\n    [\u003cAlbums: Kamikaze\u003e, \u003cAwards: Grammy\u003e, \u003cCars: Audi R8 Spyder\u003e]\n\n    \u003e\u003e\u003e get_related_objects_mapping(eminem)\n    {\u003cdjango.db.models.fields.related.ForeignKey: artist\u003e: set([\u003cAlbums: Kamikaze\u003e]),\n    \u003cdjango.db.models.fields.related.ForeignKey: artist\u003e: set([\u003cAwards: grammy\u003e]),\n    \u003cdjango.contrib.contenttypes.fields.GenericForeignKey object at 0x106ff1f50\u003e: set([\u003cCars: Audi R8 Spyder\u003e])}\n\n\nInstallation\n============\n\n::\n\n    pip install django-related-models\n\nDocumentation\n=============\n\nhttps://django-related-models.readthedocs.io/\n\nDevelopment\n===========\n\nThe tests are run via **tox**, which you would need to install (if you don't already have it).\n\n* To get tox just::\n\n    pip install tox\n\n* To run the all tests run::\n\n    tox\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froverdotcom%2Fdjango-related-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froverdotcom%2Fdjango-related-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froverdotcom%2Fdjango-related-models/lists"}