add kontor-blacksheep and kontor-piccolo as blueprints for new app
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Import all of the Tables subclasses in your app here, and register them with
|
||||
the APP_CONFIG.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from piccolo.conf.apps import AppConfig, get_package, table_finder
|
||||
|
||||
CURRENT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
APP_CONFIG = AppConfig(
|
||||
app_name="sql_app",
|
||||
migrations_folder_path=os.path.join(CURRENT_DIRECTORY, "piccolo_migrations"),
|
||||
table_classes=table_finder(
|
||||
modules=[".tables"],
|
||||
package=get_package(__name__),
|
||||
exclude_imported=True,
|
||||
),
|
||||
migration_dependencies=[],
|
||||
commands=[],
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
from piccolo.colmns import Integer, Varchar
|
||||
from piccolo.table import Table
|
||||
|
||||
|
||||
class Expense(Table):
|
||||
amount = Integer()
|
||||
description = Varchar()
|
||||
|
||||
|
||||
class Item(Table):
|
||||
id = Varchar(primary_key=True, default=uuid.uuid4())
|
||||
description = Text()
|
||||
Reference in New Issue
Block a user