{ "info": { "author": "Unleashed NV", "author_email": "operations@unleashed.be", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "============================================================================\nDjango AJAX Utilities\n============================================================================\n\nA few utilities for making pagination and tabbing easier. Everything should\nwork with and without javascript. If javascript is enabled, several features\nlike preloading can be obtained.\n\nCurrently, we have:\n 1. pagination\n 2. tabbing\n 3. xhr: for loading a part of the page delayed through AJAX, when it is heavy\n to render.\n\nDEPENDENCIES:\n - JQuery Javascript Library\n - {% macro %} and {% call %} template tags:\n https://github.com/citylive/Django-Template-Tags/tree/master/templatetags\n\n-------------\n1. Pagination\n-------------\n\nIn settings.py, add this application:\n\n > INSTALLED_APPS += ('django_ajax',)\n\n\nThe default styling just renders previous and next buttons. If you want links to more pages rendered, add this setting:\n\n > PAGINATION_STYLE = 'verbose'\n\n\nIn views.py\n\n > from django_ajax.pagination import paginate\n > \n > # ... read objects (Query list or other iterable object)\n > objects = range(0, 100)\n > \n > # Paginate\n > paginated_objects = paginate(request, objects, 25,\n > query_string_parameters= {'order_by': order_by, 'by': by },\n > use_get_parameters=False,\n > page_variable='page1')\n > \n > context = { 'paginated_objects': paginated_objects }\n\n\n25 tells the paginator to show no more than 25 objects per page.\nuse_get_parameters is optional, when set True, it will add all the parameters\nof the current query string (request.METAQUERY_STRING) automatically to the\npaginator links. query_string_parameters is also optional, this are other\nparameters to add to the query string of the links. page_variable is optional\ntoo. It's only required when several paginators are combined at the same page.\nThe variable should be unique for each paginator.\n\n\nIn the template:\n\n > {% load ajax_utilities %}\n > {% paginate paginated_objects %}\n > ...\n > {% for object in paginated_objects.object_list %}\n > ...\n > {% endfor %}\n > ...\n > {% endpaginate %}\n\n\nIn the base template, add this script:\n\n > \n\n\nThis javascript code will look for the previous and next link, and it will\npreload these two pages. When one of these links is clicked, the paginator body\nof the preloaded page shall be put into the body of the currently visible page.\n\nIf you have additional navigation links inside the paginator body, like\nordering column headers. Place the links in a container, classnamed\n\"pagination-helper\". This will make them use ajax too.\n\n >
\n > ...\n >
\n\n\nThe search results of a GET form can be retreived through AJAX, similar to\nloading any other page. The form should have action=\"?\" and method=\"get\"\nparameters. When enter has been pressed in this form, only the body of the paginator\nwill be reloaded, leaving the rest of the web page intact.\n\n >
\n > \n >
\n\n\nIn Javascript:\n\nIf you ever need to execute custom JS code when the paginator has replaced its\nbody; use the following javascript code:\n \n > function handler(e, containers)\n > {\n > // code to be excuted when the paginator switches from page ...\n > // `containers` is an Array of elements (jquery items) where content may have been changed.\n > }\n > $(document).bind('paginatorPageReplaced', handler);\n\n\nIf you want to delay the rendering of the paginator, because it contains some\nheavy queries, nest the paginator in an {% xhr %} template tag as follows:\n(Nesting the other way around is not yet possible, and probably never will be.)\n\n > {% load ajax_utilities %}\n > {% xhr %}\n > {% paginate paginator %}\n > ...\n > {% endpaginate %}\n > {% endxhr %}\n\n\nAdditional note:\nTo allow bookmarking of pages, the currently visible page is appended to `window.location.hash`\n\n\n\n-------------\n1. Tabbing\n-------------\n\nIn the template:\n\n > {% load ajax_utilities %}\n > {% tabpage %}\n > {% tabs %}\n > \n > {% endtabs %}\n > {% tabcontent %}\n > {% block tab_content %}\n > inherit this template and fill in the tab content by creating a block named 'tab_content'.\n > {% enblock %}\n > {% endtabcontent %}\n > {% endtabpage %}\n > \n > \n\n\nThis is usually the base template. Every tab matches a separate view, which\nrenders a template, derived from this base template. It will fill in the block\ntab_content, and mark the tab as \"selected\".\n\n\nIf you want a link inside a tab page to be opened inside the same tab, use the\ntabbing-helper-class:\n\n\n > (something which opens in this tab) \n\n\n\nIn Javascript:\n\n > function handler(e, containers)\n > {\n > // code to be excuted when the paginator switches from page ...\n > // `containers` is an Array of elements (jquery items) where content may have been changed.\n > }\n > $(document).bind('tabLoaded', handler);\n\n\n\n-------------\n1. xhr\n-------------\n\nThis is an AJAX optimazation for heavy web pages. The {% xhr %} template tags\nmarks a section of the template to be rendered during a later XML HTTP Request\n(AJAX).\n\nSo, actually, every view which template contains {% xhr %} is rendered twice.\nFirst without the slow, heavy content, where a placeholder
is inserted,\nand later on, rendering everything.\n\n\nInsert the following scripts to your HTML:\n\n > \n\n\nMark the slow parts with {% xhr %}:\n\n > {% load xhr %}\n > ... some content ...\n >\n > {% xhr %}\n > Very slow content\n > {% else %}\n > Loading, ... (insert loading message or images, ... here)\n > {% endxhr %}\n >\n > ... some content ...\n\n\nThe {% else %} part can be omitted, or it can contain a loading message.\n\nIf the slow content depends on calculations in the view, which are not\nnecessary for the other content. Make sure to not execute them during the first\nrun in the view:\n\n > def view(request):\n > if 'xhr' in request.REQUEST:\n > do_slow_calculations()\n > \n > return ...\n\n\nIn Javascript:\n\n > function handler()\n > {\n > ... (code to be excuted when the xhr content has been loaded) ...\n > $('.xhr_container').each(function () { ... } );\n > }\n > $(document).bind('xhrLoaded', handler);\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/vikingco/django-ajax-utilities", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-ajax-utilities", "package_url": "https://pypi.org/project/django-ajax-utilities/", "platform": "", "project_url": "https://pypi.org/project/django-ajax-utilities/", "project_urls": { "Homepage": "https://github.com/vikingco/django-ajax-utilities" }, "release_url": "https://pypi.org/project/django-ajax-utilities/1.2.9/", "requires_dist": null, "requires_python": "", "summary": "Pagination, xhr and tabbing utilities for the Django framework.", "version": "1.2.9" }, "last_serial": 3377564, "releases": { "1.2.7": [ { "comment_text": "", "digests": { "md5": "7a55d1e48e5050626f7545be5ed07f61", "sha256": "1fc5a8168846eac40cc3d512dc1a9fba7b6bf527c5ff3f27dccb2899df91d456" }, "downloads": -1, "filename": "django_ajax_utilities-1.2.7-py2-none-any.whl", "has_sig": false, "md5_digest": "7a55d1e48e5050626f7545be5ed07f61", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 64699, "upload_time": "2017-05-04T14:37:33", "url": "https://files.pythonhosted.org/packages/d1/bf/1dd277c777ad2e23a5e65abee168d668ab42c74f9519947b8dc282380110/django_ajax_utilities-1.2.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f445e6d281a4cd5298c90cdabd5d0ead", "sha256": "8b5d87b3d6f70525f93ea9c2cd68d5d545251ec21fbea39223218273272fb9b3" }, "downloads": -1, "filename": "django_ajax_utilities-1.2.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f445e6d281a4cd5298c90cdabd5d0ead", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 64701, "upload_time": "2017-05-04T15:30:40", "url": "https://files.pythonhosted.org/packages/cd/7a/2725da32514828a2ac5ab4ae9c521b604844a9a20cb303ee5d2b8290fc7c/django_ajax_utilities-1.2.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0412c04eab6fd2628d21be96944f5f1", "sha256": "0d7256ef465ef24b49afac9b5103328c9ca1527d5eda9dba68da74b20dc27f04" }, "downloads": -1, "filename": "django-ajax-utilities-1.2.7.tar.gz", "has_sig": false, "md5_digest": "d0412c04eab6fd2628d21be96944f5f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7997, "upload_time": "2017-05-04T14:37:28", "url": "https://files.pythonhosted.org/packages/a1/ab/52becf21309db8e11c5af91a46d1f576f5618efe38c3ae21295f7020a49f/django-ajax-utilities-1.2.7.tar.gz" } ], "1.2.8": [ { "comment_text": "", "digests": { "md5": "ad768fcbb149abd3fbeb012fd308f72e", "sha256": "b37dd19c1106788bbbc1598bd8d008d771abfa1114f2b27b63bc71bb9086bb32" }, "downloads": -1, "filename": "django_ajax_utilities-1.2.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ad768fcbb149abd3fbeb012fd308f72e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 64688, "upload_time": "2017-11-30T14:55:11", "url": "https://files.pythonhosted.org/packages/50/b6/f8c13519ab32b5edd7868aee509fdaef256bd48903d1e2c9351d92ae0382/django_ajax_utilities-1.2.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfe9700c24c6463403b5166269ac13a2", "sha256": "03268e6b679438a20cb045c473bada4bac562f08964b3ff88898d6091607c9d7" }, "downloads": -1, "filename": "django-ajax-utilities-1.2.8.tar.gz", "has_sig": false, "md5_digest": "bfe9700c24c6463403b5166269ac13a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8026, "upload_time": "2017-11-30T14:55:09", "url": "https://files.pythonhosted.org/packages/ef/d0/55d12230d3153be066cc51791d276dcdd00b6c4a3a9246fffb89235e36ee/django-ajax-utilities-1.2.8.tar.gz" } ], "1.2.9": [ { "comment_text": "", "digests": { "md5": "dca65c1ff1556f376bd8d8e9f9ecf36e", "sha256": "25c568b048498d34a3803a06026957587a5c7622e725fd0b1414a3b6cc01dc3d" }, "downloads": -1, "filename": "django_ajax_utilities-1.2.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dca65c1ff1556f376bd8d8e9f9ecf36e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 64686, "upload_time": "2017-11-30T14:55:41", "url": "https://files.pythonhosted.org/packages/2d/a6/c6c76fbe8d65982bed3b11c8d00e544c0867bff1375e14a3be7091e23120/django_ajax_utilities-1.2.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "86e34c5231793f1f9999ed0117a5cb6c", "sha256": "c4c2417105ab0a0b7b03080498f495de09c692f0e3ecccf2f77f809ca4ee42c2" }, "downloads": -1, "filename": "django-ajax-utilities-1.2.9.tar.gz", "has_sig": false, "md5_digest": "86e34c5231793f1f9999ed0117a5cb6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8031, "upload_time": "2017-11-30T14:55:38", "url": "https://files.pythonhosted.org/packages/63/52/0ef7c1a11922c97976cdfa1d6b70d664f89c11731160ce17d17eeda009f9/django-ajax-utilities-1.2.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dca65c1ff1556f376bd8d8e9f9ecf36e", "sha256": "25c568b048498d34a3803a06026957587a5c7622e725fd0b1414a3b6cc01dc3d" }, "downloads": -1, "filename": "django_ajax_utilities-1.2.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dca65c1ff1556f376bd8d8e9f9ecf36e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 64686, "upload_time": "2017-11-30T14:55:41", "url": "https://files.pythonhosted.org/packages/2d/a6/c6c76fbe8d65982bed3b11c8d00e544c0867bff1375e14a3be7091e23120/django_ajax_utilities-1.2.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "86e34c5231793f1f9999ed0117a5cb6c", "sha256": "c4c2417105ab0a0b7b03080498f495de09c692f0e3ecccf2f77f809ca4ee42c2" }, "downloads": -1, "filename": "django-ajax-utilities-1.2.9.tar.gz", "has_sig": false, "md5_digest": "86e34c5231793f1f9999ed0117a5cb6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8031, "upload_time": "2017-11-30T14:55:38", "url": "https://files.pythonhosted.org/packages/63/52/0ef7c1a11922c97976cdfa1d6b70d664f89c11731160ce17d17eeda009f9/django-ajax-utilities-1.2.9.tar.gz" } ] }