{"id":20961571,"url":"https://github.com/adamalton/django-href-field","last_synced_at":"2025-07-20T02:36:54.436Z","repository":{"id":12408271,"uuid":"15061956","full_name":"adamalton/django-href-field","owner":"adamalton","description":"Django HrefField - a model field for storing the value of an HTML href attribute ","archived":false,"fork":false,"pushed_at":"2013-12-16T11:59:21.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T07:11:29.538Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamalton.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":"2013-12-09T23:24:35.000Z","updated_at":"2013-12-16T11:59:21.000Z","dependencies_parsed_at":"2022-09-23T06:30:52.554Z","dependency_job_id":null,"html_url":"https://github.com/adamalton/django-href-field","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamalton/django-href-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamalton%2Fdjango-href-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamalton%2Fdjango-href-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamalton%2Fdjango-href-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamalton%2Fdjango-href-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamalton","download_url":"https://codeload.github.com/adamalton/django-href-field/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamalton%2Fdjango-href-field/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266058481,"owners_count":23870157,"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-19T02:14:20.400Z","updated_at":"2025-07-20T02:36:54.404Z","avatar_url":"https://github.com/adamalton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-href-field\n=================\n\nDjango HrefField - a model field for storing the value of an HTML href attribute\n\n\n## Spec\n\n`HreField` takes the following keyword arguments:\n\n* `protocols` (iterable) - allows you to specify which protocols are allowed.\n  * Defaults to `('http', 'https', 'mailto', 'tel')`.\n  * You may add other protocols such as `ftp`, `spotify`, `javascript` or `myownprotocol`.\n  * Validators are provided for the default protocols plus `ftp`.  You will need to provide your own validation for other protocols via the `validators` keyword argument.\n* `allow_paths` (boolean) - specifies whether protocol-less paths, such as `/` or `/about-us` are allowed.\n  * Defaults to `True`.\n* `allow_fragments` (boolean) - specifies whether fragment only hrefs such as `#edit` are allowed.\n  * Defaults to `True`.\n* `allow_query_strings` (boolean)- specifies whether query string-only hrefs such as `?sausage=1` are allowed.\n  * Defaults to `True`.\n\n`HrefField` is a subclass of `CharField`, so it exhibits the same behaviour in terms of `blank` and `null`, i.e. it defaults to `\"\"`, so `null=True` is not required unless you specifically want to store `None`.\n\n\n## Example\n\n```\nclass Link(models.Model):\n\n    text = models.CharField(max_length=100)\n\n    href = HrefField(\n        protocols=('http', 'https', 'mailto'),\n        blank=True,\n    )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamalton%2Fdjango-href-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamalton%2Fdjango-href-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamalton%2Fdjango-href-field/lists"}