{ "info": { "author": "Justin Locsei", "author_email": "justin.locsei@oberlin.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Diplomat\n========\n\nDiplomat provides Django models for the countries and languages covered by the \nISO 3166 and ISO 639 standards, respectively. Diplomat is implemented as a \nwrapper around a subset of pycountry, and its interface should feel familiar to \nusers of that module.\n\nInstallation\n============\n\nAdd `diplomat` to your `INSTALLED_APPS`, then run the `syncdb` command, which\nwill create the required language and country models.\n\nModel Usage\n===========\n\nDiplomat's field models exactly mirror the attributes of the pycountry database\nobjects that they imitate. In addition to these attributes, custom manager\nmethods are available for some of the objects provided by diplomat.\n\nLanguages\n---------\n\nThe `ISOLanguage` model is a wrapper around the `pycountry.db.Language` model.\n\n >>> from diplomat.models import ISOLanguage\n >>> aragonese = ISOLanguage.objects.get(alpha2='an')\n >>> aragonese.alpha2\n u'an'\n >>> aragonese.bibliographic\n u'arg'\n >>> aragonese.terminology\n u'arg'\n >>> aragonese.name\n u'Aragonese'\n\nIn addition, it provides a custom model manager.\n\n >>> from diplomat.models import ISOLanguage\n >>> all_languages = ISOLanguage.objects.all()\n >>> basic_languages = ISOLanguage.objects.basic()\n >>> usable_languages = ISOLanguage.objects.usable()\n >>> all_languages.count() > usable_languages.count() > basic_languages.count()\n True\n >>> all([l.alpha2 for l in all_languages])\n False\n >>> all([l.alpha2 for l in basic_languages])\n True\n >>> all_languages.filter(terminology='zxx').count()\n 1\n >>> usable_languages.filter(terminology='zxx').count()\n 0\n\nCountries\n---------\n\nThe `ISOCountry` model is a wrapper around the `pycountry.db.Country` model.\n\n >>> from diplomat.models import ISOCountry\n >>> germany = ISOCountry.objects.get(alpha2='DE')\n >>> germany.alpha2\n u'DE'\n >>> germany.alpha3\n u'DEU'\n >>> germany.numeric\n u'276'\n >>> germany.name\n u'Germany'\n >>> germany.official_name\n u'Federal Republic of Germany'\n\nField Usage\n===========\n\nDiplomat provides a series of simple form fields for selecting country and\nlanguage objects. These fields, which can be imported from `diplomat.fields`,\nare as follows:\n\n**LanguageChoiceField** \nA field for selecting a single usable language.\n\n**LanguageMultipleChoiceField** \nA field for selecting multiple usable languages.\n\n**BasicLanguageChoiceField** \nA field for selecting a single basic language covered by ISO 639-1.\n\n**BasicLanguageMultipleChoiceField** \nA field for selecting multiple basic languages covered by ISO 639-1.\n\n**CountryChoiceField** \nA field for selecting a single country.\n\n**CountryMultipleChoiceField** \nA field for selecting multiple countries.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/oberlin/django-diplomat/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/oberlin/django-diplomat/", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-diplomat", "package_url": "https://pypi.org/project/django-diplomat/", "platform": "any", "project_url": "https://pypi.org/project/django-diplomat/", "project_urls": { "Download": "https://github.com/oberlin/django-diplomat/zipball/master", "Homepage": "http://github.com/oberlin/django-diplomat/" }, "release_url": "https://pypi.org/project/django-diplomat/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Language and country models for Django derived from the pycountry module.", "version": "0.2.0" }, "last_serial": 789468, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "2139176d66310f91fc0609b9d2fa0138", "sha256": "6fd2380e9dfb7934b765e14241e32b2a863763465c35a59f5faa4ed585cffbf9" }, "downloads": -1, "filename": "django-diplomat-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2139176d66310f91fc0609b9d2fa0138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25439, "upload_time": "2012-04-25T20:19:03", "url": "https://files.pythonhosted.org/packages/56/a6/d5fed141aed1f0b631638feed808345d070173e796ab587316c1f93bd019/django-diplomat-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2139176d66310f91fc0609b9d2fa0138", "sha256": "6fd2380e9dfb7934b765e14241e32b2a863763465c35a59f5faa4ed585cffbf9" }, "downloads": -1, "filename": "django-diplomat-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2139176d66310f91fc0609b9d2fa0138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25439, "upload_time": "2012-04-25T20:19:03", "url": "https://files.pythonhosted.org/packages/56/a6/d5fed141aed1f0b631638feed808345d070173e796ab587316c1f93bd019/django-diplomat-0.2.0.tar.gz" } ] }