{"id":16614938,"url":"https://github.com/dschep/django-xor-formfields","last_synced_at":"2025-10-29T19:30:15.759Z","repository":{"id":21629738,"uuid":"24950290","full_name":"dschep/django-xor-formfields","owner":"dschep","description":"Mutually Exclusive Fields\u0026Widgets for Django.","archived":false,"fork":false,"pushed_at":"2022-09-14T20:04:24.000Z","size":151,"stargazers_count":18,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-02T04:24:09.275Z","etag":null,"topics":["unmaintained"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dschep.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-10-08T16:43:13.000Z","updated_at":"2022-11-02T03:17:56.000Z","dependencies_parsed_at":"2022-08-21T20:01:07.785Z","dependency_job_id":null,"html_url":"https://github.com/dschep/django-xor-formfields","commit_stats":null,"previous_names":["dschep/django-mutuallyexclusive-formfields"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dschep%2Fdjango-xor-formfields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dschep%2Fdjango-xor-formfields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dschep%2Fdjango-xor-formfields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dschep%2Fdjango-xor-formfields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dschep","download_url":"https://codeload.github.com/dschep/django-xor-formfields/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238874393,"owners_count":19545181,"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":["unmaintained"],"created_at":"2024-10-12T02:08:13.142Z","updated_at":"2025-10-29T19:30:15.247Z","avatar_url":"https://github.com/dschep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mutually Exclusive Form Fields\n[![Build Status](https://travis-ci.org/dschep/django-xor-formfields.svg?branch=master)](https://travis-ci.org/dschep/django-xor-formfields)\n[![PyPi](https://img.shields.io/pypi/v/django-xor-formfields.svg)](https://pypi.python.org/pypi/django-xor-formfields)\n\nEasily add mutually exclusive fields to Django forms.\n## Install\n### PyPI\n```\npip install django-xor-formfields\n```\n\n### Source\n```\npython setup.py install\n```\n\n## Example mutually exclusive form field (TextInput \u0026 Select):\n```\n# with a widget inference\nMutuallyExclusiveValueField(\n    fields=(forms.TypedChoiceField(choices=[(1,1), (2,2)], coerce=int),\n            forms.IntegerField()))\n\n# manual widget creation (allows for the placeholder attr \u0026 other customization)\nMutuallyExclusiveValueField(\n    fields=(forms.IntegerField(), forms.IntegerField()),\n    widget=MutuallyExclusiveRadioWidget(widgets=[\n            forms.Select(choices=[(1,1), (2,2)]),\n            forms.TextInput(attrs={'placeholder': 'Enter a number'}),\n        ]))\n```\n\n## Using FileOrUrlField\nThis library also includes a more complete field that inherits from\n`MutuallyExclusiveValueField` that allows users to upload files via an URL or a\nfile upload. The field accepts a `to` parameter accepting the following values:\n`None, 'url', 'file'`. This value causes the field to perform either no\nnormalization, normalizatoin to an url (by storing uploaded files as media) or\nto a file (by downloading urls to an `InMemoryUploadedFile`).\n### Example:\n```\nFileOrUrlField(None) # returns UploadedFile objects or URL based on user input\nFileOrUrlField(to='file') # always validates to an UploadedFile\nFileOrUrlField(to='url', upload_to='foobar') # always validates to an URL\n```\n#### AWS note:\nThe `FileOrUrlField` supports a they keyword argument `no_aws_qs` which\ndisables aws querystring authorization if using AWS via `django-storages`\n\n## Tests \u0026 coverage!\nto run the tests simply run:\n```\nDJANGO_SETTINGS_MODULE=xorformfields.test_settings django-admin.py test xorformfields\n```\n\nCoverage results are available here: https://dschep.github.io/django-xor-formfields/htmlcov/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdschep%2Fdjango-xor-formfields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdschep%2Fdjango-xor-formfields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdschep%2Fdjango-xor-formfields/lists"}