{ "info": { "author": "Mark Hudnall", "author_email": "me@markhudnall.com", "bugtrack_url": null, "classifiers": [], "description": "dart\n======\n\nDart turns URL variables into database models with a decorator. \n\nThat means you can do something like this:\n\n.. code-block:: python\n\n @app.route('/user//tracks', methods=['GET'])\n @dart.inject(User, 'user', from_var='user_id')\n def user_tracks(user=None):\n return jsonify(user.tracks)\n\nIf you're smart, you might have a decorator that checks user authorization,\nsomething like ``@login_required``. You can compose Dart with other decorators \nto simplify logic, while still keeping your code readable and concise: \n\n.. code-block:: python\n\n def login_required(view):\n @functools.wraps(view)\n @dart.inject(User, 'user', from_var='user_id')\n @dart.inject(User, 'current_user', from_val=lambda: session['user_id'])\n def decorated_view(user=None, current_user=None, *args, **kwargs):\n if current_user != user:\n abort(403) \n else:\n return view(user=user, *args, **kwargs)\n return decorated_view\n\n @login_required\n def view(user=None):\n return '{} did it!'.format(user.name)\n\nOf course, Dart isn't just a Flask. It's literally just a decorator that\ntakes a keyword arg or lambda expression and queries the model class using it as \nthe primary key. That means you can use the Dart decorator with any function.\n\nFor more info, check out the source code -- it's 27 lines.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/landakram/dart", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "dart", "package_url": "https://pypi.org/project/dart/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dart/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/landakram/dart" }, "release_url": "https://pypi.org/project/dart/1.0/", "requires_dist": null, "requires_python": null, "summary": "Turn URL variables into models.", "version": "1.0" }, "last_serial": 1053192, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "2e03a30f08f7eab3573141e5f653f17c", "sha256": "967f3d0beb0db32f8c3cb868d701cf7b1e59227b94be305a955d59ac066173ab" }, "downloads": -1, "filename": "dart-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e03a30f08f7eab3573141e5f653f17c", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3447, "upload_time": "2014-04-07T01:07:34", "url": "https://files.pythonhosted.org/packages/f2/c4/eb080648ebdee8f9342e5f8af59b9643f645123e4334b37e2c7684fa1435/dart-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "983df0e6edd6b3b1bc57a2fd1878176d", "sha256": "fdceb359ee781e7853186cfc39d061902fb2d2d8573f90430323a9ff784c2c06" }, "downloads": -1, "filename": "dart-1.0.tar.gz", "has_sig": false, "md5_digest": "983df0e6edd6b3b1bc57a2fd1878176d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1952, "upload_time": "2014-04-07T01:07:12", "url": "https://files.pythonhosted.org/packages/89/f7/63c55a348968a67d8034b12d98c0b9213204722d7cccbfe296b185cd3bb6/dart-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e03a30f08f7eab3573141e5f653f17c", "sha256": "967f3d0beb0db32f8c3cb868d701cf7b1e59227b94be305a955d59ac066173ab" }, "downloads": -1, "filename": "dart-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e03a30f08f7eab3573141e5f653f17c", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3447, "upload_time": "2014-04-07T01:07:34", "url": "https://files.pythonhosted.org/packages/f2/c4/eb080648ebdee8f9342e5f8af59b9643f645123e4334b37e2c7684fa1435/dart-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "983df0e6edd6b3b1bc57a2fd1878176d", "sha256": "fdceb359ee781e7853186cfc39d061902fb2d2d8573f90430323a9ff784c2c06" }, "downloads": -1, "filename": "dart-1.0.tar.gz", "has_sig": false, "md5_digest": "983df0e6edd6b3b1bc57a2fd1878176d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1952, "upload_time": "2014-04-07T01:07:12", "url": "https://files.pythonhosted.org/packages/89/f7/63c55a348968a67d8034b12d98c0b9213204722d7cccbfe296b185cd3bb6/dart-1.0.tar.gz" } ] }