{ "info": { "author": "Igor `idle sign` Starikov", "author_email": "idlesign@yandex.ru", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "django-xross\n============\nhttps://github.com/idlesign/django-xross\n\n.. image:: https://img.shields.io/pypi/v/django-xross.svg\n :target: https://pypi.python.org/pypi/django-xross\n\n.. image:: https://img.shields.io/pypi/dm/django-xross.svg\n :target: https://pypi.python.org/pypi/django-xross\n\n.. image:: https://img.shields.io/pypi/l/django-xross.svg\n :target: https://pypi.python.org/pypi/django-xross\n\n.. image:: https://img.shields.io/coveralls/idlesign/django-xross/master.svg\n :target: https://coveralls.io/r/idlesign/django-xross\n\n.. image:: https://img.shields.io/travis/idlesign/django-xross/master.svg\n :target: https://travis-ci.org/idlesign/django-xross\n\n.. image:: https://landscape.io/github/idlesign/django-xross/master/landscape.svg?style=flat\n :target: https://landscape.io/github/idlesign/django-xross/master\n\n\nDescription\n-----------\n\n*Reusable application for Django nicely bridging client and server sides.*\n\nStreamline you server and client interaction using some declarative techniques in your HTML,\nand a couple of xross functions in your views.\n\n\nSomewhere in your `views.py`:\n\n.. code-block:: python\n\n from django.shortcuts import render\n from xross.toolbox import xross_view, xross_listener # That's all we need from xross.\n\n\n def list_news(request):\n \"\"\"This function will be used by xross to load news using AJAX.\"\"\"\n news = ... # Here we fetch some news from DB.\n return render(request, 'mytemplates/sub_news.html', {'news': news})\n\n\n @xross_view(list_news) # Decorate your view - instruct xross to use `list_news` when needed.\n def index_page(request):\n \"\"\"This is our view to streamline.\"\"\"\n\n xross_listener() # xross will handle AJAX calls from that moment.\n\n return render(request, 'mytemplates/index.html')\n\n\n\nNow to your `mytemplates/index.html`:\n\n.. code-block:: html\n\n \n \n
\n \n \n\n \n \n \n \n \n