Skip to content

Commit 91713b2

Browse files
21 - Your First Database Model
1 parent c49c841 commit 91713b2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
*.py[cod]
33
.web
44
__pycache__/
5-
venv/
5+
venv/
6+
alembic/
7+
alembic.ini

full_stack_python/pages/contact.py

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
from .. import navigation
55
from ..ui.base import base_page
66

7+
class ContactEntryModel(rx.Model, table=True):
8+
first_name: str
9+
last_name: str
10+
email: str
11+
message: str
12+
713

814
class ContactState(rx.State):
915
form_data: dict = {}

rxconfig.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
config = rx.Config(
44
app_name="full_stack_python",
5+
db_url="sqlite:///reflex.db",
56
)

0 commit comments

Comments
 (0)