{ "info": { "author": "Arman Roomana", "author_email": "roomana.arman@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[](https://pypi.python.org/pypi/django-jalali-date)\n[](https://pypistats.org/packages/django-jalali-date)\n[](https://github.com/a-roomana/django-jalali-date)\n# django-jalali-date\n\nJalali Date support for user interface. Easy conversion of DateTimeFiled to JalaliDateTimeField within the admin site, view and templates.\n\n----------\n**DEPENDENCY**\n\nTo use this module you need to install jdatetime(and of course you need django) and pytz module which you can install it with easy_install or pip\n\n----------\n**INSTALL**\n\n pip install django-jalali-date \n\n----------\n**USAGE**\n\nsettings.py\n```python\nINSTALLED_APPS = [\n\t'django_apps',\n\t\n\t'jalali_date',\n\t\n\t'my_apps',\n]\n\n# defaults\nJALALI_DATE_DEFAULTS = {\n 'Strftime': {\n 'date': '%y/%m/%d',\n 'datetime': '%H:%M:%S _ %y/%m/%d',\n },\n 'Static': {\n 'js': [\n # loading default jQuery\n 'admin/jquery.ui.datepicker.jalali/scripts/jquery-1.10.2.min.js',\n # loading datepicker\n 'admin/js/django_jalali.min.js',\n # OR\n # 'admin/jquery.ui.datepicker.jalali/scripts/jquery-1.10.2.min.js',\n # 'admin/jquery.ui.datepicker.jalali/scripts/jquery.ui.core.js',\n # 'admin/jquery.ui.datepicker.jalali/scripts/calendar.js',\n # 'admin/jquery.ui.datepicker.jalali/scripts/jquery.ui.datepicker-cc.js',\n # 'admin/jquery.ui.datepicker.jalali/scripts/jquery.ui.datepicker-cc-fa.js',\n # 'admin/js/main.js',\n ],\n 'css': {\n 'all': [\n 'admin/jquery.ui.datepicker.jalali/themes/base/jquery-ui.min.css',\n ]\n }\n },\n}\n```\n\nviews.py\n```python\nfrom jalali_date import datetime2jalali, date2jalali\n\ndef my_view(request):\n\tjalali_join = datetime2jalali(request.user.date_joined).strftime('%y/%m/%d _ %H:%M:%S')\n```\nforms.py\n```python\nfrom django import forms\nfrom jalali_date.fields import JalaliDateField, SplitJalaliDateTimeField\nfrom jalali_date.widgets import AdminJalaliDateWidget, AdminSplitJalaliDateTime\n\n\nclass TestForm(forms.ModelForm):\n class Meta:\n model = TestModel\n fields = ('name', 'date', 'date_time')\n\n def __init__(self, *args, **kwargs):\n super(TestForm, self).__init__(*args, **kwargs)\n self.fields['date'] = JalaliDateField(label=_('date'), # date format is \"yyyy-mm-dd\"\n widget=AdminJalaliDateWidget # optional, to use default datepicker\n )\n\n # you can added a \"class\" to this field for use your datepicker!\n # self.fields['date'].widget.attrs.update({'class': 'jalali_date-date'})\n\n self.fields['date_time'] = SplitJalaliDateTimeField(label=_('date time'), \n widget=AdminSplitJalaliDateTime # required, for decompress DatetimeField to JalaliDateField and JalaliTimeField\n )\n```\ntemplate.html\n```html \n{% load jalali_tags %}\n\n
{{ request.user.date_joined|to_jalali:'%y/%m/%d _ %H:%M:%S' }}
\n\n\n\n\n\t\n\t\t\n\t\t\n\t\n\t\n\t\t{{ form.media }}\n```\n\n\nadmin.py\n```python\nfrom django.contrib import admin\nfrom jalali_date.admin import ModelAdminJalaliMixin, StackedInlineJalaliMixin, TabularInlineJalaliMixin\t\n \nclass MyInlines1(TabularInlineJalaliMixin, admin.TabularInline):\n\tmodel = SecendModel\n\nclass MyInlines2(StackedInlineJalaliMixin, admin.StackedInline):\n\tmodel = ThirdModel\n\t\n@admin.register(FirstModel)\nclass FirstModelAdmin(ModelAdminJalaliMixin, admin.ModelAdmin):\n\tinlines = (MyInlines1, MyInlines2, )\n\traw_id_fields = ('some_fields', )\n\treadonly_fields = ('some_fields', 'date_field',)\n\t# you can override formfield, for example:\n\tformfield_overrides = {\n\t JSONField: {'widget': JSONEditor},\n\t}\n```\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://pypi.python.org/pypi/django-jalali-date/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/a-roomana/django-jalali-date", "keywords": "django jalali date", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-jalali-date", "package_url": "https://pypi.org/project/django-jalali-date/", "platform": "any", "project_url": "https://pypi.org/project/django-jalali-date/", "project_urls": { "Download": "https://pypi.python.org/pypi/django-jalali-date/", "Homepage": "http://github.com/a-roomana/django-jalali-date" }, "release_url": "https://pypi.org/project/django-jalali-date/0.2.10/", "requires_dist": null, "requires_python": "", "summary": "Jalali Date support for user interface. Easy conversion of DateTimeFiled to JalaliDateTimeField within the admin site, views, forms and templates.", "version": "0.2.10" }, "last_serial": 5438229, "releases": { "0.1.0": [], "0.1.10": [ { "comment_text": "", "digests": { "md5": "653ffcb62443cc9781702e343f0ab81a", "sha256": "a351ef3ad0ccaaf9d6105dd2ebc340c085af067a2592eb018ac1b5140ef0df56" }, "downloads": -1, "filename": "django_jalali_date-0.1.10-py2-none-any.whl", "has_sig": false, "md5_digest": "653ffcb62443cc9781702e343f0ab81a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 194622, "upload_time": "2017-01-03T22:12:26", "url": "https://files.pythonhosted.org/packages/74/51/b1af871cc01fae0ea038fe6b4b598fd4e99d0bd9b6b76a95911fb0dadfc3/django_jalali_date-0.1.10-py2-none-any.whl" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "70a8ec2ac03e0c5d182770da53cc343d", "sha256": "6858943358ee3bbe4cce852fc036179ba7f0d5a1ee6987f98e993cc46b50b3b3" }, "downloads": -1, "filename": "django-jalali-date-0.1.7.tar.gz", "has_sig": false, "md5_digest": "70a8ec2ac03e0c5d182770da53cc343d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 178168, "upload_time": "2016-07-26T11:57:52", "url": "https://files.pythonhosted.org/packages/3a/a8/37ef3c6459e8584df481e285cad071338141f1d57dc4afef80eb6696c8fe/django-jalali-date-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "e717bfb2ffa4928728a892b87481cdcd", "sha256": "f9fc3291c85b83680b4f494e69ac91209fedb90f5c15b6d42f93ea626f97af93" }, "downloads": -1, "filename": "django-jalali-date-0.1.8.tar.gz", "has_sig": false, "md5_digest": "e717bfb2ffa4928728a892b87481cdcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 180901, "upload_time": "2016-07-26T12:13:06", "url": "https://files.pythonhosted.org/packages/97/59/8fcda7452c91742b7ef7abe30bf77bf2e8d3de416e793685b8bba1587aac/django-jalali-date-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "065c006f69713ea8b574dc8d260ed5bb", "sha256": "772055fa0ea45f1612e7b7eadf764b2f01052c4fbafb08d0d378a45513dd8b04" }, "downloads": -1, "filename": "django-jalali-date-0.1.9.tar.gz", "has_sig": false, "md5_digest": "065c006f69713ea8b574dc8d260ed5bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 181104, "upload_time": "2016-07-27T22:25:32", "url": "https://files.pythonhosted.org/packages/de/25/4fef28a2141c406c40c470d16ad59c1d9a201ad5ba236dc1906dfd7d6728/django-jalali-date-0.1.9.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c2c48e3df5e5140e251aa6f28130d2ea", "sha256": "f2cb5c80d3665ff921aa318785a751aa9435bfd7d8756118917eaa716b30cb2a" }, "downloads": -1, "filename": "django-jalali-date-0.2.0.zip", "has_sig": false, "md5_digest": "c2c48e3df5e5140e251aa6f28130d2ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 198452, "upload_time": "2017-05-07T14:43:21", "url": "https://files.pythonhosted.org/packages/64/5e/f8055ce356c4e403251fdb1a25d426a57e5d62882efe58fc14ed28b97a8d/django-jalali-date-0.2.0.zip" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "422cd219c6209db13eabc46099bc512f", "sha256": "9dade29ae8d08e5d7e1776da9274f81c3397c714bf6eca5d4a0aca40a984dbe4" }, "downloads": -1, "filename": "django-jalali-date-0.2.1.tar.gz", "has_sig": false, "md5_digest": "422cd219c6209db13eabc46099bc512f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 179692, "upload_time": "2017-05-25T20:26:45", "url": "https://files.pythonhosted.org/packages/db/7a/667301195798446b01f6397127494200425c0701ee183f68521feb5f64fc/django-jalali-date-0.2.1.tar.gz" } ], "0.2.10": [ { "comment_text": "", "digests": { "md5": "603801fa7c91ae99fb35a429b4be2d8f", "sha256": "1d6d3e5c30841a7c68a51534375800e1d7947a9533ba5afee7a26701f79137c7" }, "downloads": -1, "filename": "django-jalali-date-0.2.10.tar.gz", "has_sig": false, "md5_digest": "603801fa7c91ae99fb35a429b4be2d8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218723, "upload_time": "2019-06-23T20:54:23", "url": "https://files.pythonhosted.org/packages/ad/aa/a7c28d57dc04964f86da2bb60f75147177ecfbbfcfc0a09962e9efc3d3ee/django-jalali-date-0.2.10.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a0af5be09c5e6e0b0e93348f04d1f647", "sha256": "7ae4ff4d69a0db22d20b560c5d04641bc301d1da10788358b18fc6b1fed31015" }, "downloads": -1, "filename": "django-jalali-date-0.2.2.tar.gz", "has_sig": false, "md5_digest": "a0af5be09c5e6e0b0e93348f04d1f647", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 179715, "upload_time": "2017-06-16T13:04:23", "url": "https://files.pythonhosted.org/packages/e9/c7/108e2884b3b6c573c645bddad40f7c537098ee89c009b1404ec6a8d01c11/django-jalali-date-0.2.2.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "424299002ce06449121cc115b27f2ef3", "sha256": "6815f3b1b9b69e42791af64bbb31cf03e802740f17bf4419d10b8c42ae07af24" }, "downloads": -1, "filename": "django-jalali-date-0.2.4.tar.gz", "has_sig": false, "md5_digest": "424299002ce06449121cc115b27f2ef3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 182148, "upload_time": "2017-08-19T08:54:04", "url": "https://files.pythonhosted.org/packages/0a/59/239272b4e7d60369787d9b1a1be357a6da8b9a74e0777a8111f76e56bcb3/django-jalali-date-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "1f303eb1c001dcd042282359dc9cbb62", "sha256": "734c68e50e00006fa8a9a1b2dece2bfb7afb28d848699254813ef9837d6eadf9" }, "downloads": -1, "filename": "django-jalali-date-0.2.5.tar.gz", "has_sig": false, "md5_digest": "1f303eb1c001dcd042282359dc9cbb62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 182984, "upload_time": "2017-08-24T08:56:58", "url": "https://files.pythonhosted.org/packages/85/64/1c32496cf126a2e124c0a971a28d3ed461f993426f1b791519461652881f/django-jalali-date-0.2.5.tar.gz" } ], "0.2.6.1": [ { "comment_text": "", "digests": { "md5": "bad8d20493fb679290c379c205058b75", "sha256": "d9f54e7ccaabb39355d3349c4303d2aef07e8f47ec39d9b9520a584831dc609a" }, "downloads": -1, "filename": "django-jalali-date-0.2.6.1.tar.gz", "has_sig": false, "md5_digest": "bad8d20493fb679290c379c205058b75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 170841, "upload_time": "2017-09-11T21:14:22", "url": "https://files.pythonhosted.org/packages/3e/28/07258fabce15232301e7361c33bd3d14cefbdad7962aff23379aeb6c576e/django-jalali-date-0.2.6.1.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "5eaf7359d29fc5fb182df2393ad6fe94", "sha256": "7455c89b007d979d4f7afa215b19aef4243cba106ac50166d03e0b58f141c0e5" }, "downloads": -1, "filename": "django-jalali-date-0.2.7.tar.gz", "has_sig": false, "md5_digest": "5eaf7359d29fc5fb182df2393ad6fe94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216914, "upload_time": "2017-09-19T20:03:57", "url": "https://files.pythonhosted.org/packages/21/3a/615ef457d2e906ab54d0578caf5850b4c459c8127ab79d13c73543fafdef/django-jalali-date-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "f11f6dcdd5c07231a56d2051a18ff4d0", "sha256": "3c2a69cb8c3423a4a92fd9ac84598a520b1f98a312a486437d7492403c2b8f9d" }, "downloads": -1, "filename": "django-jalali-date-0.2.8.tar.gz", "has_sig": false, "md5_digest": "f11f6dcdd5c07231a56d2051a18ff4d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218332, "upload_time": "2018-04-18T18:36:26", "url": "https://files.pythonhosted.org/packages/3b/3a/66f7c3ffb2571c46f015061cf577b0d6794e5b07f9513955c38c5caa295a/django-jalali-date-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "abdea7c4845df924e9f70a1d61ef4eaf", "sha256": "d0e4938eeea9e08e99ed7a4186c984b29700fecc42c7fe0947833e32bdff8bc9" }, "downloads": -1, "filename": "django-jalali-date-0.2.9.tar.gz", "has_sig": false, "md5_digest": "abdea7c4845df924e9f70a1d61ef4eaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218269, "upload_time": "2018-07-06T11:12:37", "url": "https://files.pythonhosted.org/packages/ff/88/534825ca1917036e0539735049ac652356cb00decb858df82e5dcce33096/django-jalali-date-0.2.9.tar.gz" } ], "0.2.9a1": [ { "comment_text": "", "digests": { "md5": "e82f4e653ad4e2885df7ac3f67c7549c", "sha256": "62ab8efdf1d6ad9c186b36586d75964059409f8892666247c95959f2ec56aa69" }, "downloads": -1, "filename": "django-jalali-date-0.2.9a1.tar.gz", "has_sig": false, "md5_digest": "e82f4e653ad4e2885df7ac3f67c7549c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218275, "upload_time": "2018-04-27T15:39:05", "url": "https://files.pythonhosted.org/packages/0e/fe/41b7371f4152102cbc3bffa8b4e8c738deee3f0ea5f0b9b1925c4aeb51df/django-jalali-date-0.2.9a1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "603801fa7c91ae99fb35a429b4be2d8f", "sha256": "1d6d3e5c30841a7c68a51534375800e1d7947a9533ba5afee7a26701f79137c7" }, "downloads": -1, "filename": "django-jalali-date-0.2.10.tar.gz", "has_sig": false, "md5_digest": "603801fa7c91ae99fb35a429b4be2d8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218723, "upload_time": "2019-06-23T20:54:23", "url": "https://files.pythonhosted.org/packages/ad/aa/a7c28d57dc04964f86da2bb60f75147177ecfbbfcfc0a09962e9efc3d3ee/django-jalali-date-0.2.10.tar.gz" } ] }