{ "info": { "author": "Your Name", "author_email": "yourname@example.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "===============\ndrf-api-actions\n===============\n\n\u63d0\u4f9bdjango\u4e0brest framework\u7684coreapi\u4fbf\u6377\u8c03\u7528\n\nQuick start for django 2.0+\n-----------\n1. Install::\n\n pip install drf_api_actions>=2.0\n\n\n2. [Optional] Include the drf_api_actions URLconf in your project urls.py like this::\n\n if settings.DEBUG:\n urlpatterns += [\n url('^', include('drf_api_actions.urls'))\n ]\n\n # after add this you can visit: /docs /schema /api.js\n\n3. No migrate needed:\n\n4. Sample::\n\n # Add \"sample\" to your INSTALLED_APPS setting like this ::\n INSTALLED_APPS = [\n ...\n 'sample',\n ]\n\n # Include the sample URLconf in your project urls.py like this::\n urlpatterns += [\n url('^', include('sample.urls'))\n ]\n\n # Run server and visit /docs /schema /api.js\n\n5. Examples::\n\n # Views\n class UsersAPIView(APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868\n\n \u8fd4\u56de\u503c\uff1a\u7528\u6237\u5217\u8868 `['a', 'b', ...]`\n\n \"\"\"\n\n def get(self, request):\n return Response(['a', 'b'])\n\n\n class UsersActionReadAPIView(ActionReadMixin, APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868, \u7528\u4e86`ActionReadMixin`\u540e\u8fd9\u662f\u4e00\u4e2a\u7528 Read\n\n \u8fd4\u56de\u503c\uff1a\u7528\u6237\u5217\u8868 `['a', 'b', ...]`\n\n \"\"\"\n\n def get(self, request):\n return Response(['a', 'b'])\n\n\n class UsersExtraFieldsAPIView(APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868, \u5e26user_id/user_name\u4f1a\u8fc7\u6ee4\n\n \u8fd4\u56de\u503c\uff1a\n - \u5e26user_id: `['a']`\n - \u4e0d\u5e26user_id: `['a','b']`\n \"\"\"\n\n schema = AutoSchema(manual_fields=[\n coreapi.Field(name='user_id', location='query', required=True,\n schema=coreschema.String(description='\u7528\u6237\u7684id')),\n ])\n\n def get(self, request):\n user_id = request.GET.get('user_id', '')\n if user_id:\n return Response(['a'])\n else:\n return Response(['a', 'b'])\n\n # Url settings\n url('^docs/', Views.docs_as_view(title='API'))\n url('^schema/', Views.schema_as_view(title='API'))\n url('^api.js', Views.api_js_as_view(title='API'))\n\n\n\nQuick start for django 1.0+\n-----------\n1. Install::\n\n pip install drf_api_actions==0.2.0\n\n\n2. [Optional] Include the drf_api_actions URLconf in your project urls.py like this::\n\n if settings.DEBUG:\n urlpatterns += [\n url('^', include('drf_api_actions.urls'))\n ]\n\n # after add this you can visit: /docs /schema /api.js\n\n3. No migrate needed:\n\n4. Sample::\n\n # Add \"sample\" to your INSTALLED_APPS setting like this ::\n INSTALLED_APPS = [\n ...\n 'sample',\n ]\n\n # Include the sample URLconf in your project urls.py like this::\n urlpatterns += [\n url('^', include('sample.urls'))\n ]\n\n # Run server and visit /docs /schema /api.js\n\n5. Examples::\n\n # Views\n class UsersAPIView(APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868\n\n \u8fd4\u56de\u503c\uff1a\u7528\u6237\u5217\u8868 `['a', 'b', ...]`\n\n \"\"\"\n\n def get(self, request):\n return Response(['a', 'b'])\n\n\n class UsersActionReadAPIView(ActionReadMixin, APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868, \u7528\u4e86`ActionReadMixin`\u540e\u8fd9\u662f\u4e00\u4e2a\u7528 Read\n\n \u8fd4\u56de\u503c\uff1a\u7528\u6237\u5217\u8868 `['a', 'b', ...]`\n\n \"\"\"\n\n def get(self, request):\n return Response(['a', 'b'])\n\n\n class UsersExtraFieldsAPIView(APIView):\n \"\"\"\n \u83b7\u5f97\u7528\u6237\u5217\u8868, \u5e26user_id/user_name\u4f1a\u8fc7\u6ee4\n\n \u8fd4\u56de\u503c\uff1a\n - \u5e26user_id: `['a']`\n - \u4e0d\u5e26user_id: `['a','b']`\n \"\"\"\n\n extra_fields = [\n coreapi.Field(name='user_id', location='query', required=False,\n schema=coreschema.String(description='\u7528\u6237id'))\n ]\n\n def get(self, request):\n user_id = request.GET.get('user_id', '')\n if user_id:\n return Response(['a'])\n else:\n return Response(['a', 'b'])\n\n # Url settings\n url('^docs/', Views.docs_as_view(title='API'))\n url('^schema/', Views.schema_as_view(title='API'))\n url('^api.js', Views.api_js_as_view(title='API'))", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "drf-api-actions", "package_url": "https://pypi.org/project/drf-api-actions/", "platform": "", "project_url": "https://pypi.org/project/drf-api-actions/", "project_urls": null, "release_url": "https://pypi.org/project/drf-api-actions/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "drf api actions for django", "version": "2.0.0" }, "last_serial": 3533460, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "20826f0ffa4e791e4f1f12dfe21ca738", "sha256": "7a313f662b2f7ad0b516cfee505c035a553dced9cad3e5edc5cfaa598c972602" }, "downloads": -1, "filename": "drf-api-actions-0.1.0.tar.gz", "has_sig": false, "md5_digest": "20826f0ffa4e791e4f1f12dfe21ca738", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7409, "upload_time": "2017-08-16T03:24:54", "url": "https://files.pythonhosted.org/packages/0c/75/6f939f7c658eb1641530e459101a89811ae82bab06eaad72c19a351711c3/drf-api-actions-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8f59f491ca3f9531e63c1eb27e2c3363", "sha256": "38458c710e8996a72a45cafb0dfbbe343038d648e0ce61929d54f7b55fb25176" }, "downloads": -1, "filename": "drf-api-actions-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8f59f491ca3f9531e63c1eb27e2c3363", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7375, "upload_time": "2017-08-16T06:20:34", "url": "https://files.pythonhosted.org/packages/ae/7f/3bd19ca7fd35b5321b142af26c6736db0339c38b74f3cb853b85de3dd3bc/drf-api-actions-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c7970088b794bcf20ff2e6113f12894b", "sha256": "94dbe234c7df5e747adee98ae0aae4fce64c64b8cbeb407a9d62d4ddba4c663a" }, "downloads": -1, "filename": "drf-api-actions-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c7970088b794bcf20ff2e6113f12894b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7587, "upload_time": "2017-08-21T02:29:25", "url": "https://files.pythonhosted.org/packages/d0/00/33fa83694d628a34856b0f95b2a907c3ac261321edfa97062554fd68c880/drf-api-actions-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fd2e8913c1bdb9c8349e2450ef206b55", "sha256": "6407455279cfd61a89ec3bdc099d46f4d4d83b278ce6b5074bd597e59de561b1" }, "downloads": -1, "filename": "drf-api-actions-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fd2e8913c1bdb9c8349e2450ef206b55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7743, "upload_time": "2017-08-22T03:26:46", "url": "https://files.pythonhosted.org/packages/15/59/74ab52b18699efd9d6a6bd171b85c1d43ed1ffd0a8738cefa6cd32b6ce2a/drf-api-actions-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "58bffb2fb21fc135e07da3773810f39b", "sha256": "ec496fd71d784b1965d6bb74c7bc26af599fd480a6d5c79a97f9c143872adf78" }, "downloads": -1, "filename": "drf-api-actions-0.2.0.tar.gz", "has_sig": false, "md5_digest": "58bffb2fb21fc135e07da3773810f39b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7996, "upload_time": "2018-01-03T06:34:09", "url": "https://files.pythonhosted.org/packages/91/dd/181a21c4840b3ba6bbcaf5eacdfbed56f7d4463797e5bad2632ae38c76d4/drf-api-actions-0.2.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "340bac929942e65d6914ff2bee5058bc", "sha256": "1087a4f310534f473a05d35391e175f2a80abc66aa1f856fcf1c129590da7c63" }, "downloads": -1, "filename": "drf-api-actions-2.0.0.tar.gz", "has_sig": false, "md5_digest": "340bac929942e65d6914ff2bee5058bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7803, "upload_time": "2018-01-30T01:16:17", "url": "https://files.pythonhosted.org/packages/15/12/fe4d334d608106aec1c1540293699c0bfbcc077bebcb68995cc18fda3c41/drf-api-actions-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "340bac929942e65d6914ff2bee5058bc", "sha256": "1087a4f310534f473a05d35391e175f2a80abc66aa1f856fcf1c129590da7c63" }, "downloads": -1, "filename": "drf-api-actions-2.0.0.tar.gz", "has_sig": false, "md5_digest": "340bac929942e65d6914ff2bee5058bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7803, "upload_time": "2018-01-30T01:16:17", "url": "https://files.pythonhosted.org/packages/15/12/fe4d334d608106aec1c1540293699c0bfbcc077bebcb68995cc18fda3c41/drf-api-actions-2.0.0.tar.gz" } ] }