{"id":19839461,"url":"https://github.com/scientifichackers/django-hideshow","last_synced_at":"2025-10-05T13:32:04.414Z","repository":{"id":133157911,"uuid":"243825491","full_name":"scientifichackers/django-hideshow","owner":"scientifichackers","description":"Dynamically hide/show Django admin form fields using only HTML attributes. No javascript required. ™️","archived":false,"fork":false,"pushed_at":"2020-02-28T18:55:07.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T22:20:39.939Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scientifichackers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-28T18:09:15.000Z","updated_at":"2023-09-19T02:59:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"42ac592d-a05e-42d5-a5fb-d3c537b6591c","html_url":"https://github.com/scientifichackers/django-hideshow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scientifichackers/django-hideshow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fdjango-hideshow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fdjango-hideshow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fdjango-hideshow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fdjango-hideshow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scientifichackers","download_url":"https://codeload.github.com/scientifichackers/django-hideshow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fdjango-hideshow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265427771,"owners_count":23763394,"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-12T12:22:45.437Z","updated_at":"2025-10-05T13:32:04.363Z","avatar_url":"https://github.com/scientifichackers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django hideshow\n\nDynamically hide/show Django admin form fields using only HTML attributes. No javascript required. ™️\n\n1. Add js file url to your model admin form's media class -\n\n```python\nclass MyModelForm(ModelForm):\n    class Media:\n        js = (\n            \"https://cdn.jsdelivr.net/gh/scientifichackers/django-hideshow@0.0.1/hideshow.js\",\n        )          \n```\n\n2. Declare HTML attributes on any fields you want - \n\n```python\nclass MyModelForm(ModelForm):\n    class Meta:\n        widgets = {\n            \"some_integer_choice_field\": forms.Select(\n                attrs={\n                    # all hidden by default\n                    \"--hideshow-fields\": \"a1, a2, a3, a4\",\n                    # a2, a4 visible when \"0\" is selected\n                    \"--show-on-0\": \"a2, a4\",\n                    # a1, a2 visible when \"1\" is selected\n                    \"--show-on-1\": \"a1, a2\",\n                }\n            ),\n            \"some_boolean_field\": forms.CheckboxInput(\n                attrs={\n                    \"--hideshow-fields\": \"b1, b2, b3\",\n                    # b1, b2 visible if checkbox checked\n                    # b3 visible if checkbox un-checked\n                    \"--show-on-checked\": \"b1, b2\",\n                }\n            ),\n        }   \n```\n\n3. See it work -\n\n[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/PeQ_uQuaTCI/0.jpg)](https://www.youtube.com/watch?v=PeQ_uQuaTCI)\n\n[Full Example](myapp/admin.py)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientifichackers%2Fdjango-hideshow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscientifichackers%2Fdjango-hideshow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientifichackers%2Fdjango-hideshow/lists"}