MCPcopy Create free account
hub / github.com/codingforentrepreneurs/full-stack-python / UserInfo

Class UserInfo

full_stack_python/models.py:11–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9from . import utils
10
11class UserInfo(rx.Model, table=True):
12 email: str
13 user_id: int = Field(foreign_key='localuser.id')
14 user: LocalUser | None = Relationship() # LocalUser instance
15 posts: List['BlogPostModel'] = Relationship(
16 back_populates='userinfo'
17 )
18 contact_entries: List['ContactEntryModel'] = Relationship(
19 back_populates='userinfo'
20 )
21 created_at: datetime = Field(
22 default_factory=utils.timing.get_utc_now,
23 sa_type=sqlalchemy.DateTime(timezone=True),
24 sa_column_kwargs={
25 'server_default': sqlalchemy.func.now()
26 },
27 nullable=False
28 )
29 updated_at: datetime = Field(
30 default_factory=utils.timing.get_utc_now,
31 sa_type=sqlalchemy.DateTime(timezone=True),
32 sa_column_kwargs={
33 'onupdate': sqlalchemy.func.now(),
34 'server_default': sqlalchemy.func.now()
35 },
36 nullable=False
37 )
38
39
40class BlogPostModel(rx.Model, table=True):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected