{ "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 >