{"id":17761814,"url":"https://github.com/romgar/django-dirtyfields","last_synced_at":"2025-05-14T02:06:42.769Z","repository":{"id":1062583,"uuid":"898046","full_name":"romgar/django-dirtyfields","owner":"romgar","description":"Tracking dirty fields on a Django model","archived":false,"fork":false,"pushed_at":"2025-03-22T09:46:21.000Z","size":430,"stargazers_count":638,"open_issues_count":14,"forks_count":111,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2025-04-13T20:17:42.444Z","etag":null,"topics":["django","python"],"latest_commit_sha":null,"homepage":"","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/romgar.png","metadata":{"files":{"readme":"README.rst","changelog":"ChangeLog.rst","contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-09-09T06:54:09.000Z","updated_at":"2025-04-10T15:29:14.000Z","dependencies_parsed_at":"2023-07-05T20:17:10.004Z","dependency_job_id":"dc1c21cf-ba1b-4cb0-9ff1-d466cc3a02c4","html_url":"https://github.com/romgar/django-dirtyfields","commit_stats":{"total_commits":465,"total_committers":42,"mean_commits":"11.071428571428571","dds":0.6043010752688172,"last_synced_commit":"f48bbe975c627f3f7577f018992a44b1b1cbad8d"},"previous_names":["smn/django-dirtyfields"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgar%2Fdjango-dirtyfields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgar%2Fdjango-dirtyfields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgar%2Fdjango-dirtyfields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romgar%2Fdjango-dirtyfields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romgar","download_url":"https://codeload.github.com/romgar/django-dirtyfields/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248774961,"owners_count":21159534,"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":["django","python"],"created_at":"2024-10-26T19:46:06.687Z","updated_at":"2025-04-13T20:17:47.357Z","avatar_url":"https://github.com/romgar.png","language":"Python","readme":"===================\nDjango Dirty Fields\n===================\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n   :alt: Join the chat at https://gitter.im/romgar/django-dirtyfields\n   :target: https://gitter.im/romgar/django-dirtyfields?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n.. image:: https://img.shields.io/pypi/v/django-dirtyfields.svg\n   :alt: Published PyPI version\n   :target: https://pypi.org/project/django-dirtyfields/\n.. image:: https://github.com/romgar/django-dirtyfields/actions/workflows/tests.yml/badge.svg\n   :alt: Github Actions Test status\n   :target: https://github.com/romgar/django-dirtyfields/actions/workflows/tests.yml\n.. image:: https://coveralls.io/repos/github/romgar/django-dirtyfields/badge.svg?branch=develop\n   :alt: Coveralls code coverage status\n   :target: https://coveralls.io/github/romgar/django-dirtyfields?branch=develop\n.. image:: https://readthedocs.org/projects/django-dirtyfields/badge/?version=latest\n   :alt: Read the Docs documentation status\n   :target: https://django-dirtyfields.readthedocs.io/en/latest/\n\nTracking dirty fields on a Django model instance.\nDirty means that field in-memory and database values are different.\n\nThis package is compatible and tested with the following Python \u0026 Django versions:\n\n\n+------------------------+-----------------------------------+\n| Django                 | Python                            |\n+========================+===================================+\n| 2.2, 3.0, 3.1          | 3.9                               |\n+------------------------+-----------------------------------+\n| 3.2, 4.0               | 3.9, 3.10                         |\n+------------------------+-----------------------------------+\n| 4.1                    | 3.9, 3.10, 3.11                   |\n+------------------------+-----------------------------------+\n| 4.2                    | 3.9, 3.10, 3.11, 3.12             |\n+------------------------+-----------------------------------+\n| 5.0                    | 3.10, 3.11, 3.12                  |\n+------------------------+-----------------------------------+\n| 5.1                    | 3.10, 3.11, 3.12, 3.13            |\n+------------------------+-----------------------------------+\n\n\n\nInstall\n=======\n\n.. code-block:: bash\n\n    $ pip install django-dirtyfields\n\n\nUsage\n=====\n\nTo use ``django-dirtyfields``, you need to:\n\n- Inherit from ``DirtyFieldsMixin`` in the Django model you want to track.\n\n.. code-block:: python\n\n    from django.db import models\n    from dirtyfields import DirtyFieldsMixin\n\n    class ExampleModel(DirtyFieldsMixin, models.Model):\n        \"\"\"A simple example model to test dirty fields mixin with\"\"\"\n        boolean = models.BooleanField(default=True)\n        characters = models.CharField(blank=True, max_length=80)\n\n- Use one of these 2 functions on a model instance to know if this instance is dirty, and get the dirty fields:\n\n  * ``is_dirty()``\n  * ``get_dirty_fields()``\n\n\nExample\n-------\n\n.. code-block:: python\n\n    \u003e\u003e\u003e model = ExampleModel.objects.create(boolean=True,characters=\"first value\")\n    \u003e\u003e\u003e model.is_dirty()\n    False\n    \u003e\u003e\u003e model.get_dirty_fields()\n    {}\n\n    \u003e\u003e\u003e model.boolean = False\n    \u003e\u003e\u003e model.characters = \"second value\"\n\n    \u003e\u003e\u003e model.is_dirty()\n    True\n    \u003e\u003e\u003e model.get_dirty_fields()\n    {'boolean': True, \"characters\": \"first_value\"}\n\n\nConsult the `full documentation \u003chttps://django-dirtyfields.readthedocs.io/\u003e`_ for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromgar%2Fdjango-dirtyfields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromgar%2Fdjango-dirtyfields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromgar%2Fdjango-dirtyfields/lists"}