{ "info": { "author": "Benjamin Murden", "author_email": "benmurden@github.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-intl-tel-input2\n======================\n\nA fork from https://github.com/charly06/django-intl-tel-input\nwhich is a fork from https://github.com/benmurden/django-intl-tel-input\nA Django form widget based on the jQuery plugin `intl-tel-input`_.\n\nThis release is only to make the fork available to install as django-intl-tel-input2\n\nThis is a new package, so it doesn't implement all the features of\nintl-tel-input. However, it has been stable in testing.\n\nInstallation\n------------\n\nInstall from PyPI.\n\n.. code:: shell\n\n pip install django-intl-tel-input2\n\nAdd intl-tel-input to your INSTALLED\\_APPS, so Django can find the init\nscript.\n\n.. code:: python\n\n ...\n INSTALLED_APPS += ('intl_tel_input',)\n ...\n\nUsage\n-----\n\nSimply add ``IntlTelInputWidget`` to your form field. It will add a visible text input field and a hidden input field.\n\n.. code:: python\n\n from intl_tel_input.widgets import IntlTelInputWidget\n\n class MyForm(forms.ModelForm):\n class Meta:\n model = MyModel\n fields = ['foo', 'bar']\n widgets = {\n 'bar': IntlTelInputWidget()\n }\n ...\n\nWith a standard form:\n\n.. code:: python\n\n class MyForm(forms.Form):\n tel_number = forms.CharField(widget=IntlTelInputWidget(\n visible_input_attrs={\n 'size': '30',\n 'class': 'my-css-class',\n ...\n },\n hidden_input_attrs={\n 'class': 'another-css-class',\n ...\n }\n ))\n ...\n\nThe two arguments ``visible_input_attrs`` and ``hidden_input_attrs`` can be used to add additional HTML \nattributes to the visible text input field respectively to the hidden input field. \n\n\nForm media\n----------\n\nIf you have included jQuery at the end of your document, then don't\nforget to update the template where this widget appears with a\n``{{ form.media.js }}``. Put it in a block that allows it to come after\njQuery.\n\nIf you load jQuery in the head of your document, you needn't worry about\nthis step - widget media will be inserted right after the field. If you\nwant to keep all JS at the end of your document, you can still use the\n``{{ form.media.js }}`` tag to achieve that. However, if you use `crispy-forms`_,\nyou need to set ``include_media = False`` in order to assure that ``init.js``\ngets loaded **after** jQuery and consequently to avoid JS errors:\n\n.. code:: python\n\n class MyForm(forms.Form):\n def __init__(self, *args, **kwargs):\n ...\n self.helper = FormHelper()\n self.helper.include_media = False\n ...\n\nIf you use ``self.helper.include_media = False`` in your form, you\nhave to add ``{{ form.media.css }}`` to your template\nwhere this widget appears in order to load ``intlTelInput.css``.\n\nIf you need to load all JS in the head, you can make the ``init.js`` script\nwait for the document to be ready with the following snippet.\n\n.. code:: javascript\n\n jQuery(document).ready(\n {{ form.media.js }}\n );\n \nAll this assumes your form context variable is called ``form``.\n\n.. _intl-tel-input: https://github.com/jackocnr/intl-tel-input\n.. _crispy-forms: https://github.com/django-crispy-forms/django-crispy-forms\n\nOptions\n-------\n\nThe widget can be invoked with most keyword arguments which translate to the `options`_\navailable in the jQuery plugin intl-tel-input.\n\nallow_dropdown\n Type: ``Boolean`` Default: ``True``\n\n Example usage:\n\n .. code:: python\n \n class MyForm(forms.Form):\n tel_number = forms.CharField(widget=IntlTelInputWidget(\n allow_dropdown=False,\n ))\n ...\n\nauto_hide_dial_code\n Type: ``Boolean`` Default: ``True``\n\nauto_placeholder\n Type: ``String`` Default: ``\"polite\"``\n\ncustom_placeholder\n This option is not implemented yet.\n\ndropdown_container\n Type: ``String`` Default: ``\"\"``\n\nexclude_countries\n Type: ``List`` Default: ``[]``\n\n Example usage:\n\n .. code:: python\n \n class MyForm(forms.Form):\n tel_number = forms.CharField(widget=IntlTelInputWidget(\n exclude_countries=['at', 'de', 'ch'],\n ))\n ...\n\nformat_on_display\n Type: ``Boolean`` Default: ``True``\n\nauto_geo_ip\n Type: ``Boolean`` Default: ``False``\n\n This option represents geoIpLookup. If set to ``True``, the user's location is lookup up. \n In order to lookup the user's location, https://freegeoip.net/json/ is used.\n\ninitial_country\n Type: ``String`` Default: ``\"\"``\n\nnational_mode\n Type: ``Boolean`` Default: ``True``\n\nplaceholder_number_type\n Type: ``String`` Default: ``\"MOBILE\"``\n\nonly_countries \n Type: ``List`` Default: ``[]`` \n\npreferred_countries\n Type: ``List`` Default: ``['us', 'gb']``\n\nseparate_dial_code\n Type: ``Boolean`` Default: ``False``\n\n.. _options: https://github.com/jackocnr/intl-tel-input/blob/master/README.md#options\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rhooper/django-intl-tel-input", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-intl-tel-input2", "package_url": "https://pypi.org/project/django-intl-tel-input2/", "platform": "", "project_url": "https://pypi.org/project/django-intl-tel-input2/", "project_urls": { "Homepage": "https://github.com/rhooper/django-intl-tel-input" }, "release_url": "https://pypi.org/project/django-intl-tel-input2/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "A Django form widget implementing intl-tel-input.", "version": "0.2.0" }, "last_serial": 3533481, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "8c40fd6a0a7b383111b4745ebd4f36fe", "sha256": "0e6a42c3fc06d66e7bc901602143eee5409f6070e40859076cad6b768e681ea7" }, "downloads": -1, "filename": "django-intl-tel-input2-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c40fd6a0a7b383111b4745ebd4f36fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6736, "upload_time": "2018-01-30T01:20:20", "url": "https://files.pythonhosted.org/packages/07/d3/c65b8e91b26151b3d353c0fc5297f9b0a9ec31f7da6f7fdca6c0716082f9/django-intl-tel-input2-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c40fd6a0a7b383111b4745ebd4f36fe", "sha256": "0e6a42c3fc06d66e7bc901602143eee5409f6070e40859076cad6b768e681ea7" }, "downloads": -1, "filename": "django-intl-tel-input2-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8c40fd6a0a7b383111b4745ebd4f36fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6736, "upload_time": "2018-01-30T01:20:20", "url": "https://files.pythonhosted.org/packages/07/d3/c65b8e91b26151b3d353c0fc5297f9b0a9ec31f7da6f7fdca6c0716082f9/django-intl-tel-input2-0.2.0.tar.gz" } ] }