{ "info": { "author": "Martin Martimeo", "author_email": "martin@martimeo.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "tornado-backbone\n================\n\nCreate backbone models from sqlalchemy models.\n\nBackbone allows to represent your data as models in JavaScript.\nHowever you may not want to do your modeling twice in sqlalchemy aswell in backbone.\nTornado-Backbone approaches to generate the JavaScript models from your sqlalchemy orm.\n\nIt's main intention is to work with tornado-restless (and is compatible with flask-restless as api backend),\nso there are some specific 'hacks' for them.\n\nDevelopment Status\n==================\n\nThe implementation is currently still a bleeding edge without many documentation,\nbut I hope to provide a meaningful documentation soon.\n\nrequire\n=======\n\nTornado Backbone uses require.js for his depencies and for loading required models.\n\nThe shim we use in production looks like:\n\n require.config({\n baseUrl: '/static/',\n paths: {\n underscore: \"{{ handler.request.protocol }}://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min\",\n backbone: \"{{ handler.request.protocol }}://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min\",\n \"backbone-forms\": \"{{ handler.request.protocol }}://cdnjs.cloudflare.com/ajax/libs/backbone-forms/0.12.0/backbone-forms\",\n \"backbone-relational\": \"{{ handler.request.protocol }}://cdnjs.cloudflare.com/ajax/libs/backbone-relational/0.8.5/backbone-relational\"\n },\n shim: {\n underscore: {\n exports: '_'\n },\n backbone: {\n deps: [\"underscore\", \"jquery\"],\n exports: \"Backbone\"\n },\n \"backbone-forms\": {\n deps: [\"backbone\"]\n },\n \"backbone-relational\": {\n deps: [\"backbone\"]\n }\n }\n });\n\n\nbackbone-forms\n==============\n\nA version of Backbone-Forms is included in the distribution folder, a copy of it can be\nobtained from https://github.com/powmedia/backbone-forms . Note that you must include the list\neditor as soon as you use relationship properties.\n\nIf you want to have support for backbone-forms include the `form.js`.\nTornado Backbone exposes all information of the `info` dict as schema attribute in the backbone model\n and falls back on some defaults if there is no information (like for integer).\nFor interaction with backbone-forms you can define for example your column like:\n\n class User(Base):\n email = Column(String, info={'type': 'Text', 'dataType': 'email', 'validators': ['email']})\n\nAnd then create a form like:\n\n require(['/api/js/user'], function () {\n var user = new UserModel();\n\n var form = new Backbone.Form({\n model: user\n }).render();\n $('body').append(form.el);\n }\n\nOr directly use a bootstrap similiar approach:\n\n
\n User Form\n\n \n
\n
\n\nAll options for Backbone.Form can be passed as data-\\* attributes.\nIf you have relations in your model that you want to use, it may require to load the depencies:\n\n class UserTitle(Base):\n id: Column(Integer)\n title: Column(String)\n\n class User(Base):\n title_id = Column(ForeignId(UserTitle.id))\n title = relationship(UserTitle)\n email = Column(String, info={'type': 'Text', 'dataType': 'email', 'validators': ['email']})\n\nLeads to displaying a form with email and title:\n\n
\n User Form\n\n
\n
\n
\n\nbackbone-relations\n==================\n\nTornado Backbone exposes relations in a backbone-relations compatible way.\nIf you include `relations.js` in your project all models will be based on Backbone.RelationalModel\n\nCopyright license\n=================\n\ntornado-backbone is licensed under the GNU Affero General Public License, for more information see the LICENSE.txt.\n\nInstalling\n==========\n\ntornado-backbone was developed under python3.3, sqlalchemy0.9 and tornado3.1\n\nIt may work with sqlalchemy 0.8 and older tornado releases but I did not test it at all.\n\nTo install this libary as an egg use:\n\n python setup.py install", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/Tornado-Backbone", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MartinMartimeo/tornado-backbone", "keywords": null, "license": "GNU AGPLv3+", "maintainer": null, "maintainer_email": null, "name": "Tornado-Backbone", "package_url": "https://pypi.org/project/Tornado-Backbone/", "platform": "any", "project_url": "https://pypi.org/project/Tornado-Backbone/", "project_urls": { "Download": "http://pypi.python.org/pypi/Tornado-Backbone", "Homepage": "https://github.com/MartinMartimeo/tornado-backbone" }, "release_url": "https://pypi.org/project/Tornado-Backbone/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "backbone models from sqlalchemy orm for tornado-restless", "version": "0.2.2" }, "last_serial": 986045, "releases": { "0.1.0": [], "0.2.0": [], "0.2.2": [] }, "urls": [] }