Skip to content

Commit

Permalink
refactor: add schema files and rename views to blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Dec 20, 2023
1 parent eb724e3 commit 47ad0c1
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pdm serve
You can create tables in the database by running:

```bash
pdm drop-tables
pdm create-tables
```

Expand Down
10 changes: 5 additions & 5 deletions backend/bamboo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from apiflask import APIFlask

from bamboo.views.admin import admin_bp
from bamboo.views.auth import auth_bp
from bamboo.views.blog import blog_bp
from bamboo.views.page import page_bp
from bamboo.views.talk import talk_bp
from bamboo.blueprints.admin import admin_bp
from bamboo.blueprints.auth import auth_bp
from bamboo.blueprints.blog import blog_bp
from bamboo.blueprints.page import page_bp
from bamboo.blueprints.talk import talk_bp
from bamboo.core.extensions import db, migrate
from bamboo.core.commands import register_commands
from bamboo.settings import config
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions backend/bamboo/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime

from sqlalchemy import Column, Integer, String, Text, ForeignKey, \
Boolean, DateTime, Float
Boolean, DateTime, Float, JSON
from sqlalchemy.orm import relationship
from werkzeug.security import generate_password_hash, check_password_hash

Expand Down Expand Up @@ -61,7 +61,7 @@ class Media(db.Model):
class Site(db.Model):
__tablename__ = 'site'
id = Column(Integer, primary_key=True)
config = Column(Text)
config = Column(JSON)
template_url = Column(String)
deploy_target = Column(String)
deploy_method = Column(String)
Expand Down Expand Up @@ -267,6 +267,7 @@ class ScheduleItem(db.Model):


class Venue(db.Model):
__tablename__ = 'venue'
id = Column(Integer, primary_key=True)
name = Column(String(30))
address = Column(String(500))
Expand Down
1 change: 0 additions & 1 deletion backend/bamboo/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from apiflask import Schema, fields, validators
1 change: 1 addition & 0 deletions backend/bamboo/schemas/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from apiflask import Schema, fields, validators
1 change: 1 addition & 0 deletions backend/bamboo/schemas/auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from apiflask import Schema, fields, validators
1 change: 1 addition & 0 deletions backend/bamboo/schemas/blog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from apiflask import Schema, fields, validators
1 change: 1 addition & 0 deletions backend/bamboo/schemas/page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from apiflask import Schema, fields, validators
1 change: 1 addition & 0 deletions backend/bamboo/schemas/talk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from apiflask import Schema, fields, validators
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ package-type = "application"

[tool.pdm.scripts]
serve = { shell = "flask run", help = "Run the development server" }
create-tables = { shell = "cd backend && flask create-tables", help = "Create tables" }
drop-tables = { shell = "cd backend && flask drop-tables", help = "Drop tables" }
create-tables = { shell = "flask create-tables", help = "Create tables" }
drop-tables = { shell = "flask drop-tables", help = "Drop tables" }

[tool.pdm.dev-dependencies]
test = [
Expand Down

0 comments on commit 47ad0c1

Please sign in to comment.