{ "info": { "author": "Fantomas42", "author_email": "support@emencia.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.4", "Framework :: Django :: 1.5", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. _Django: https://www.djangoproject.com/\n\n========================\nEmencia Django Countries\n========================\n\nA Django application who contains world country list that can be displayed with a priority order.\n\nUsefull for forms or for models which needs a country list ordered.\n\n.. contents::\n\nLinks\n*****\n\n* Download his `PyPi package `_;\n* Clone it on his `repository `_;\n\nRequires\n********\n\n* ``setuptools``;\n* `Django`_ >= 1.4 (should be compatible to *Django 1.8* and beyond);\n\nInstall\n*******\n\nFirst install the package: ::\n\n pip install emencia.django.countries\n\nAdd it to your installed Django apps in settings:\n\n.. sourcecode:: python\n\n INSTALLED_APPS = (\n ...\n 'emencia.django.countries',\n ...\n )\n \nFinally run the Django commands ``migrate`` to install app database tables, this will also fill ``Country`` model with initial datas for countries.\n\nUsage\n*****\n\nBy default when the fixture is loaded all the countries a leveled to 0, \nthe default and displayed by alphabetical order.\n\n.. sourcecode:: python\n\n >>> from emencia.django.countries.models import Country\n >>> Country.objects.all()\n [, , , '...(remaining elements truncated)...']\n\nSo if you don't want to display *Afghanistan* as the first country of your list, \nyou have a set a high value to the **level** attribute for all the countries you want.\n\nNow if you want to retrieve your country list ordered do this:\n\n.. sourcecode:: python\n\n >>> france = Country.objects.get(iso='FR')\n >>> france.level = 100\n >>> france.save()\n\n >>> Country.objects.all()\n [, , , '...(remaining elements truncated)...']\n\nBut if you only want a short list of countries with the level attribute set, you can do this:\n\n.. sourcecode:: python\n\n >>> Country.objects.leveled()\n []\n\nThis will return only the countries with a level value different than 0.\n\nTemplate Context Processors\n---------------------------\n\nSometimes it can be usefull to have all the countries in the context for rendering templates,\nso a template context processor is provided.\n\n.. sourcecode:: python\n\n >>> TEMPLATE_CONTEXT_PROCESSORS = (\n ... # Your template context processors\n ... 'emencia.django.countries.context_processors.countries',\n ... )\n\nThis template context processor, provides 2 variables in the context :\n\n* COUNTRIES_LIST\n* COUNTRIES_LIST_LEVELED\n\nTemplate tags\n-------------\n\nBut in general it's a waste of ressources to have all the countries loaded in the context,\nbecause it make a database request for each request, so template tags have been implemented.\n\nIn your templates, to get the countries list, simply do this. ::\n\n {% load countries_tags %}\n\n {% get_countries %}\n\nIt will load the countries list in the local context of the template, in a variable named **COUNTRIES**\nBut if you want to change the name of this variable use this syntax. ::\n\n {% get_countries as MY_COUNTRIES %}\n\nIf you only want to have the short list of countries, use this tag. ::\n\n {% get_countries_leveled as MY_COUNTRIES %}\n\nOf course the same syntax apply to this tag.\n\n\nChangelog\n=========\n\nVersion 0.2.1 - 2015/12/10\n--------------------------\n\n* Fixed bad path for ``HISTORY.rst`` in ``setup.py``;\n\nVersion 0.2.0 - 2015/12/10\n--------------------------\n\n* Ensure compatibility with ``Django>=1.7``:\n \n * Added compatibility support in model manager with ``get_queryset`` method;\n * Added Django migration;\n * Now loading initial data fixtures from a data migration since ``Django>=1.7`` don't do it automatically anymore;\n\n* Update setup.py for better package classifier and packages infos;\n\nVersion 0.1.1 - 2013/09/26\n--------------------------\n\n* Fix package MANIFEST for missing rule for fixture data file;\n\nVersion 0.1 - 2013/05/03\n------------------------\n\n* First release as a package;", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/emencia/emencia-django-countries", "keywords": "django,countries", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "emencia.django.countries", "package_url": "https://pypi.org/project/emencia.django.countries/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/emencia.django.countries/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/emencia/emencia-django-countries" }, "release_url": "https://pypi.org/project/emencia.django.countries/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "List of manageable countries for your Django projects", "version": "0.2.2" }, "last_serial": 1856690, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d4c368f19837c061761ba99325fcf3cc", "sha256": "e6cf198556140a64c21180e9ebf21515830edeca8cf91e1d193952dc454b3bac" }, "downloads": -1, "filename": "emencia.django.countries-0.1.tar.gz", "has_sig": false, "md5_digest": "d4c368f19837c061761ba99325fcf3cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7155, "upload_time": "2013-05-03T18:19:29", "url": "https://files.pythonhosted.org/packages/75/93/d53d932c3e12d329af51ad7a7baa2ed418f9f691538839306ad2b0a32df0/emencia.django.countries-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "def6c565d25c49a811008e1bc46e4deb", "sha256": "44ae76258f6762f1afbeba83f5371848bfa7ada002e3cf8c3239ac5c33cd97c0" }, "downloads": -1, "filename": "emencia.django.countries-0.1.1.tar.gz", "has_sig": false, "md5_digest": "def6c565d25c49a811008e1bc46e4deb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15890, "upload_time": "2013-09-27T12:59:12", "url": "https://files.pythonhosted.org/packages/95/14/cb617a4f230faecf6abefefa0f0ed871289bc6de0bf4b8014829f18c2263/emencia.django.countries-0.1.1.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1539133c0bc51d94e580d502a45277bb", "sha256": "915ba01093079f8af0419508dcab646ffff6648cd6195fb8ab6001dfd26e57c4" }, "downloads": -1, "filename": "emencia.django.countries-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1539133c0bc51d94e580d502a45277bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16639, "upload_time": "2015-12-10T16:58:02", "url": "https://files.pythonhosted.org/packages/c4/fb/91ea34f40dab3debb740d6ea8248d7dbc4b0babf2eaca7f0695619212f7e/emencia.django.countries-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "938dcf7738a23503beec589f47e3d1d8", "sha256": "8854f22172c36383ec44e2d68a07146e9869585a9badb0e28011cac6969a1f06" }, "downloads": -1, "filename": "emencia.django.countries-0.2.2.tar.gz", "has_sig": false, "md5_digest": "938dcf7738a23503beec589f47e3d1d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17541, "upload_time": "2015-12-10T23:19:48", "url": "https://files.pythonhosted.org/packages/e7/30/272880f3572bc9cd9c0ebb830a64f6f3cae7700ec747657612cc070e5acb/emencia.django.countries-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "938dcf7738a23503beec589f47e3d1d8", "sha256": "8854f22172c36383ec44e2d68a07146e9869585a9badb0e28011cac6969a1f06" }, "downloads": -1, "filename": "emencia.django.countries-0.2.2.tar.gz", "has_sig": false, "md5_digest": "938dcf7738a23503beec589f47e3d1d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17541, "upload_time": "2015-12-10T23:19:48", "url": "https://files.pythonhosted.org/packages/e7/30/272880f3572bc9cd9c0ebb830a64f6f3cae7700ec747657612cc070e5acb/emencia.django.countries-0.2.2.tar.gz" } ] }