MCPcopy Create free account
hub / github.com/erans/pgsqlite / Post

Class Post

benchmarks/test_sqlalchemy.py:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 )
49
50class Post(Base):
51 __tablename__ = 'posts'
52
53 id = Column(Integer, primary_key=True)
54 title = Column(String(200), nullable=False)
55 content = Column(Text)
56 author_id = Column(Integer, ForeignKey('users.id'))
57 view_count = Column(Integer, default=0)
58 rating = Column(Float)
59 published = Column(Boolean, default=False)
60 published_at = Column(DateTime)
61 tags = Column(JSON)
62
63 # Relationships
64 author = relationship("User", back_populates="posts")
65 comments = relationship("Comment", back_populates="post", cascade="all, delete-orphan")
66
67class Comment(Base):
68 __tablename__ = 'comments'

Callers 3

test_relationshipsMethod · 0.70
test_joinsMethod · 0.70
test_subqueriesMethod · 0.70

Calls

no outgoing calls

Tested by 3

test_relationshipsMethod · 0.56
test_joinsMethod · 0.56
test_subqueriesMethod · 0.56