-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from swelcker/0.1.5
0.1.5
- Loading branch information
Showing
335 changed files
with
86,113 additions
and
10,838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
dist/* linguist-vendored | ||
docs/* linguist-vendored | ||
docs_dist_site/* linguist-vendored | ||
dist/* linguist-documentation | ||
docs/* linguist-documentation | ||
docs_dist_site/* linguist-documentation | ||
msaSDK/msastatic/* linguist-vendored | ||
*.html linguist-detectable=false | ||
*.js linguist-detectable=false | ||
*.css linguist-detectable=false | ||
*.css linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/msaSDK.egg-info/ | ||
/msaSDK/msa_sdk.json | ||
/msaSDK/msa_sdk.sqlite_db | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Required MSAApp Service Definition (Settings): | ||
|
||
sqlite_db_crud: bool = True | ||
|
||
### Example Usage of MSAApp.utils.crud | ||
|
||
```python | ||
|
||
from typing import Optional, List | ||
|
||
from sqlmodel import SQLModel | ||
|
||
from msaSDK.admin.utils.fields import Field | ||
from msaSDK.models.service import get_msa_app_settings | ||
from msaSDK.service import MSAApp | ||
|
||
class TestArticle(SQLModel, table=True): | ||
__table_args__ = {'extend_existing': True} | ||
id: Optional[int] = Field(default=None, primary_key=True, nullable=False) | ||
title: str = Field(title='ArticleTitle', max_length=200) | ||
description: Optional[str] = Field(default='', title='ArticleDescription', max_length=400) | ||
status: bool = Field(None, title='status') | ||
content: str = Field(title='ArticleContent') | ||
|
||
|
||
class TestCategory(SQLModel, table=True): | ||
__table_args__ = {'extend_existing': True} | ||
id: Optional[int] = Field(default=None, primary_key=True, nullable=False) | ||
title: str = Field(title='ArticleTitle', max_length=200) | ||
description: Optional[str] = Field(default='', title='ArticleDescription', max_length=400) | ||
status: bool = Field(None, title='status') | ||
content: str = Field(title='ArticleContent') | ||
|
||
|
||
get_msa_app_settings.cache_clear() | ||
settings = get_msa_app_settings() | ||
settings.title = "u2d.ai - MSA/SDK MVP" | ||
settings.version = "0.0.1" | ||
settings.debug = True | ||
|
||
app = MSAApp(settings=settings, auto_mount_site=True, | ||
sql_models=[TestArticle, TestCategory], | ||
contact={"name": "msaSDK", "url": "http://u2d.ai", "email": "[email protected]"}, | ||
license_info={"name": "MIT", "url": "https://opensource.org/licenses/MIT", }) | ||
|
||
app.logger.info("Initialized " + settings.title + " " + settings.version) | ||
|
||
|
||
if __name__ == '__main__': | ||
pass | ||
``` | ||
|
||
### Here the API routes you get from this: | ||
![CRUD API Router](../images/msa_example_crud.png) |
Oops, something went wrong.