Name | leanit-mweb JSON |
Version |
23.7.3
JSON |
| download |
home_page | |
Summary | Web framework |
upload_time | 2023-07-10 12:26:13 |
maintainer | |
docs_url | None |
author | Martin Klapproth |
requires_python | |
license | |
keywords |
python
web
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Lean IT Mweb Framework
write a python function which gets a html input. The function should return a Form objects. The Form objects represents data parsed from the html <form> tag. The following code should work:
```python
html = "<html>...</html>"
# Form.parse is a classmethod, stores the html in the form object, parses the action, method and inputs in the __init__ method and manages a data dict with the input values
form = Form.parse(html)
# if multiple forms are in the html, you can use
# parse_forms(html, index=0) to get the first form
# or parse_forms(html, id="form_id") to get the form with the given id
# or parse_forms(html, name="form_name") to get the form with the given name
form.fill(name="foo") # fill the form with data, updates form.data dict
# submit the form and get the response
# uses e.g. client.get("/workspace/create-first", allow_redirects=False)
# or client.post("/workspace/create-first", allow_redirects=False)
# based on the method and action of the form
response = form.submit(client)
```
Do not use beatifulsoup or other html parsers. Use regex to parse the html.
----
I have a python program which has an init() method. While executing the init method I fetch the current module name:
```python
class App:
def init(self):
module_name = self.__module__ # "mium_frontend"
```
there is a mium_frontend.models.user module which contains a "User" class which inherits from a "Model" class.
write code which automatically imports all classes from the "models" package. The import should take place in the init() method of the App class. Handle situations where there is no models package (there are apps without models). Handle situations with multiple levels of packages under the models package (e.g. models.foo.bar.User). Create a list of all classes which inherit from the Model class. The list should contain the classes, not the strings with the class names.
Raw data
{
"_id": null,
"home_page": "",
"name": "leanit-mweb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,web",
"author": "Martin Klapproth",
"author_email": "martin.klapproth@staxnet.de",
"download_url": "https://files.pythonhosted.org/packages/1c/7d/f7a9b598d2b801d2bf0ac43d6ff972f1b881237a26638e50da099cb3108e/leanit-mweb-23.7.3.tar.gz",
"platform": null,
"description": "\nLean IT Mweb Framework\n\nwrite a python function which gets a html input. The function should return a Form objects. The Form objects represents data parsed from the html <form> tag. The following code should work:\n\n```python\nhtml = \"<html>...</html>\"\n# Form.parse is a classmethod, stores the html in the form object, parses the action, method and inputs in the __init__ method and manages a data dict with the input values\nform = Form.parse(html) \n# if multiple forms are in the html, you can use\n# parse_forms(html, index=0) to get the first form\n# or parse_forms(html, id=\"form_id\") to get the form with the given id\n# or parse_forms(html, name=\"form_name\") to get the form with the given name\n\nform.fill(name=\"foo\") # fill the form with data, updates form.data dict\n\n# submit the form and get the response\n# uses e.g. client.get(\"/workspace/create-first\", allow_redirects=False)\n# or client.post(\"/workspace/create-first\", allow_redirects=False)\n# based on the method and action of the form\nresponse = form.submit(client)\n```\n\nDo not use beatifulsoup or other html parsers. Use regex to parse the html.\n\n----\n\nI have a python program which has an init() method. While executing the init method I fetch the current module name:\n\n```python\nclass App:\n def init(self):\n module_name = self.__module__ # \"mium_frontend\"\n```\n\nthere is a mium_frontend.models.user module which contains a \"User\" class which inherits from a \"Model\" class.\n\nwrite code which automatically imports all classes from the \"models\" package. The import should take place in the init() method of the App class. Handle situations where there is no models package (there are apps without models). Handle situations with multiple levels of packages under the models package (e.g. models.foo.bar.User). Create a list of all classes which inherit from the Model class. The list should contain the classes, not the strings with the class names.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Web framework",
"version": "23.7.3",
"project_urls": null,
"split_keywords": [
"python",
"web"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4ff9794d5ffaa058fee663d4ccea125f20cc652309cb102b62ebd3b5a897e6af",
"md5": "8c095a2208422bea0910873e8d7352ea",
"sha256": "676bca64f51d48de4ec6eb6e8ff7cde2998077f6a68d9f782bfeeb990ccae549"
},
"downloads": -1,
"filename": "leanit_mweb-23.7.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c095a2208422bea0910873e8d7352ea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 74434,
"upload_time": "2023-07-10T12:26:11",
"upload_time_iso_8601": "2023-07-10T12:26:11.014770Z",
"url": "https://files.pythonhosted.org/packages/4f/f9/794d5ffaa058fee663d4ccea125f20cc652309cb102b62ebd3b5a897e6af/leanit_mweb-23.7.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1c7df7a9b598d2b801d2bf0ac43d6ff972f1b881237a26638e50da099cb3108e",
"md5": "5e26d3d8b2e88a8de7b2c410f445d5b4",
"sha256": "949ee3581d6b544e2626464a280d1f425d1d3d6152284c10350906a18586a582"
},
"downloads": -1,
"filename": "leanit-mweb-23.7.3.tar.gz",
"has_sig": false,
"md5_digest": "5e26d3d8b2e88a8de7b2c410f445d5b4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 34296,
"upload_time": "2023-07-10T12:26:13",
"upload_time_iso_8601": "2023-07-10T12:26:13.563267Z",
"url": "https://files.pythonhosted.org/packages/1c/7d/f7a9b598d2b801d2bf0ac43d6ff972f1b881237a26638e50da099cb3108e/leanit-mweb-23.7.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 12:26:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "leanit-mweb"
}