{"id":35038222,"url":"https://github.com/ramusus/django-m2m-history","last_synced_at":"2025-12-27T08:05:04.610Z","repository":{"id":57420719,"uuid":"18289229","full_name":"ramusus/django-m2m-history","owner":"ramusus","description":"Django ManyToMany relation field with history of changes","archived":false,"fork":false,"pushed_at":"2016-06-22T10:14:30.000Z","size":71,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T22:25:47.454Z","etag":null,"topics":[],"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/ramusus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-31T10:11:10.000Z","updated_at":"2023-10-21T19:42:53.000Z","dependencies_parsed_at":"2022-09-19T00:31:09.157Z","dependency_job_id":null,"html_url":"https://github.com/ramusus/django-m2m-history","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ramusus/django-m2m-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramusus%2Fdjango-m2m-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramusus%2Fdjango-m2m-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramusus%2Fdjango-m2m-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramusus%2Fdjango-m2m-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramusus","download_url":"https://codeload.github.com/ramusus/django-m2m-history/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramusus%2Fdjango-m2m-history/sbom","scorecard":{"id":761019,"data":{"date":"2025-08-11","repo":{"name":"github.com/ramusus/django-m2m-history","commit":"60f954c423b32432bb231a96357056e787af4438"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T23:30:40.304Z","repository_id":57420719,"created_at":"2025-08-22T23:30:40.304Z","updated_at":"2025-08-22T23:30:40.304Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28075700,"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","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-27T08:04:51.769Z","updated_at":"2025-12-27T08:05:04.605Z","avatar_url":"https://github.com/ramusus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django ManyToMany History\n========================\n\n[![PyPI version](https://badge.fury.io/py/django-m2m-history.png)](http://badge.fury.io/py/django-m2m-history) [![Build Status](https://travis-ci.org/ramusus/django-m2m-history.png?branch=master)](https://travis-ci.org/ramusus/django-m2m-history) [![Coverage Status](https://coveralls.io/repos/ramusus/django-m2m-history/badge.png?branch=master)](https://coveralls.io/r/ramusus/django-m2m-history)\n\nDjango ManyToMany relation field with history of changes. Like usual Django's ManyToManyField, it's generate intermediary join table\nto represent the many-to-many relationship, but with two additional columns: 'time_from' and 'time_to'. Using updated interface of field it's\npossible to retreive history of all versions of this field's value.\n\nCompatibility\n-------------\n\n  * python v2.7, v3.4\n  * django \u003e=1.5, \u003c=1.8. **Does not compatible with Django 1.9**\n  * postgres\n\nInstallation\n------------\n\n    pip install django-m2m-history\n\nAdd into `settings.py` lines:\n\n    INSTALLED_APPS = (\n        ...\n        'm2m_history',\n    )\n\nUsage example\n-------------\n\nMake 2 models with many-to-many relationship:\n\n    class Publication(models.Model):\n        title = models.CharField(max_length=30)\n\n        def __str__(self):\n            return self.title\n\n    class Article(models.Model):\n        headline = models.CharField(max_length=100)\n        publications = ManyToManyHistoryField(Publication)\n\n        def __str__(self):\n            return self.headline\n\nCreate objects and relations betweeen them:\n\n    \u003e\u003e\u003e p1 = Publication.objects.create(title='Pub1')\n    \u003e\u003e\u003e p2 = Publication.objects.create(title='Pub2')\n    \u003e\u003e\u003e p3 = Publication.objects.create(title='Pub3')\n\n    \u003e\u003e\u003e article = Article.objects.create(headline='Article1')\n    \u003e\u003e\u003e state_time1 = datetime.now()\n\n    \u003e\u003e\u003e article.publications = [p1, p2]\n    \u003e\u003e\u003e state_time2 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n    \u003e\u003e\u003e article.publications.count()\n    2\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    2\n\n    \u003e\u003e\u003e article.publications = [p3]\n    \u003e\u003e\u003e state_time3 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    [\u003cPublication: Pub3\u003e]\n    \u003e\u003e\u003e article.publications.count()\n    1\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    3\n\n    \u003e\u003e\u003e article.publications.add(p2, p1)\n    \u003e\u003e\u003e state_time4 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e, \u003cPublication: Pub3\u003e]\n    \u003e\u003e\u003e article.publications.count()\n    3\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    5\n\n    \u003e\u003e\u003e article.publications.remove(p2, p1)\n    \u003e\u003e\u003e state_time5 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    [\u003cPublication: Pub3\u003e]\n    \u003e\u003e\u003e article.publications.count()\n    1\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    5\n\n    \u003e\u003e\u003e article.publications = [p1, p2]\n    \u003e\u003e\u003e state_time6 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n    \u003e\u003e\u003e article.publications.count()\n    2\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    7\n\n    \u003e\u003e\u003e article.publications.clear()\n    \u003e\u003e\u003e state_time7 = article.publications.last_update_time()\n    \u003e\u003e\u003e article.publications.all()\n    []\n     \u003e\u003e\u003e article.publications.count()\n    0\n    \u003e\u003e\u003e article.publications.through.objects.count()\n    7\n\nGet objects of history states by timestamps:\n\n    \u003e\u003e\u003e article.publications.were_at(state_time1)\n    []\n\n    \u003e\u003e\u003e article.publications.were_at(state_time2)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.were_at(state_time3)\n    [\u003cPublication: Pub3\u003e]\n\n    \u003e\u003e\u003e article.publications.were_at(state_time4)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e, \u003cPublication: Pub3\u003e]\n\n    \u003e\u003e\u003e article.publications.were_at(state_time5)\n    [\u003cPublication: Pub3\u003e]\n\n    \u003e\u003e\u003e article.publications.were_at(state_time6)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.were_at(state_time7)\n    []\n\nGet added and removed objects of history states by timestamps:\n\n    \u003e\u003e\u003e article.publications.added_at(state_time3)\n    [\u003cPublication: Pub3\u003e]\n\n    \u003e\u003e\u003e article.publications.removed_at(state_time3)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.added_at(state_time4)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.removed_at(state_time5)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.added_at(state_time6)\n    [\u003cPublication: Pub1\u003e, \u003cPublication: Pub2\u003e]\n\n    \u003e\u003e\u003e article.publications.removed_at(state_time6)\n    [\u003cPublication: Pub3\u003e]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framusus%2Fdjango-m2m-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framusus%2Fdjango-m2m-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framusus%2Fdjango-m2m-history/lists"}