{"id":13415781,"url":"https://github.com/edoburu/django-any-urlfield","last_synced_at":"2025-04-11T16:51:39.625Z","repository":{"id":2982906,"uuid":"3998825","full_name":"edoburu/django-any-urlfield","owner":"edoburu","description":"An improved URL selector to choose between internal models and external URLs","archived":false,"fork":false,"pushed_at":"2021-10-27T14:02:37.000Z","size":289,"stargazers_count":51,"open_issues_count":4,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T01:32:55.098Z","etag":null,"topics":["django","django-admin","django-field"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edoburu.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","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":"2012-04-11T22:01:08.000Z","updated_at":"2024-08-21T20:21:09.000Z","dependencies_parsed_at":"2022-09-13T15:24:33.989Z","dependency_job_id":null,"html_url":"https://github.com/edoburu/django-any-urlfield","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edoburu%2Fdjango-any-urlfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edoburu%2Fdjango-any-urlfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edoburu%2Fdjango-any-urlfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edoburu%2Fdjango-any-urlfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edoburu","download_url":"https://codeload.github.com/edoburu/django-any-urlfield/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248443049,"owners_count":21104327,"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","django-admin","django-field"],"created_at":"2024-07-30T21:00:52.070Z","updated_at":"2025-04-11T16:51:39.605Z","avatar_url":"https://github.com/edoburu.png","language":"Python","funding_links":[],"categories":["Third-Party Packages","Python"],"sub_categories":["Model Fields","Models"],"readme":".. image:: https://img.shields.io/pypi/v/django-any-urlfield.svg\n    :target: https://pypi.python.org/pypi/django-any-urlfield/\n.. image:: https://img.shields.io/pypi/l/django-any-urlfield.svg\n    :target: https://pypi.python.org/pypi/django-any-urlfield/\n.. image:: https://img.shields.io/codecov/c/github/edoburu/django-any-urlfield/master.svg\n    :target: https://codecov.io/github/edoburu/django-any-urlfield?branch=master\n.. image:: https://readthedocs.org/projects/django-any-urlfield/badge/?version=latest\n    :target: https://django-any-urlfield.readthedocs.io/en/latest/\n\ndjango-any-urlfield\n===================\n\nThe ``any_urlfield`` module provides an improved URL selector\nthat supports both URLs to internal models and external URLs.\n\nThis addresses is a common challenge in CMS interfaces;\nwhere providing a ``URLField`` makes it hard to enter internal URLs,\nwhile providing a ``ModelChoiceField`` makes it too inflexible.\nThis package provides the both of both worlds.\n\nFor more details, see the documentation_ at Read The Docs.\n\n\nScreenshot\n==========\n\n.. figure:: https://github.com/edoburu/django-any-urlfield/raw/master/docs/images/anyurlfield1.png\n   :width: 363px\n   :height: 74px\n   :alt: AnyUrlField, with external URL input.\n\n.. figure:: https://github.com/edoburu/django-any-urlfield/raw/master/docs/images/anyurlfield2.png\n   :width: 290px\n   :height: 76px\n   :alt: AnyUrlField, with internal page input.\n\n\nInstallation\n============\n\nFirst install the module, preferably in a virtual environment::\n\n    pip install django-any-urlfield\n\nAdd the module to the installed apps:\n\n.. code-block:: python\n\n    INSTALLED_APPS += (\n        'any_urlfield',\n    )\n\nUsage\n-----\n\nAdd the field to a Django model:\n\n.. code-block:: python\n\n    from django.db import models\n    from any_urlfield.models import AnyUrlField\n\n    class MyModel(models.Model):\n        title = models.CharField(\"Title\", max_length=200)\n        url = AnyUrlField(\"URL\")\n\nBy default, the ``AnyUrlField`` only supports linking to external pages.\n\nRegister any model that the ``AnyUrlField`` should support linking to:\n\n.. code-block:: python\n\n    from any_urlfield.models import AnyUrlField\n    AnyUrlField.register_model(Article)\n\nNow, the ``AnyUrlField`` offers users a dropdown field to directly select an article.\n\nThe default field is a ``django.forms.models.ModelChoiceField`` field\nwith a ``django.forms.widgets.Select`` widget.\nThis can be customized using the ``form_field`` and ``widget`` parameters:\n\n.. code-block:: python\n\n    from any_urlfield.models import AnyUrlField\n    from any_urlfield.forms import SimpleRawIdWidget\n\n    AnyUrlField.register_model(Article, widget=SimpleRawIdWidget(Article))\n\nThat will display the ``Article`` model as raw input field with a browse button.\n\n\nContributing\n------------\n\nThis module is designed to be generic. In case there is anything you didn't like about it,\nor think it's not flexible enough, please let us know. We'd love to improve it!\n\nIf you have any other valuable contribution, suggestion or idea,\nplease let us know as well because we will look into it.\nPull requests are welcome too. :-)\n\n\n.. _documentation: https://django-any-urlfield.readthedocs.io/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedoburu%2Fdjango-any-urlfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedoburu%2Fdjango-any-urlfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedoburu%2Fdjango-any-urlfield/lists"}