Add frontend project structure with React/TypeScript setup
This commit is contained in:
1 parent
c7abb73c66
commit
6914a6855c
58 files changed
+9056
-236
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Author model for Newzy application.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from sqlalchemy import ForeignKey, Integer, String, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from db.session import Base
|
||||
|
||||
|
||||
class Author(Base):
|
||||
"""Represents an article author."""
|
||||
|
||||
__tablename__ = "authors"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True)
|
||||
name: Mapped[str] = mapped_column(String(100), unique=True, nullable=False)
|
||||
email: Mapped[str] = mapped_column(String(255), unique=True, nullable=False)
|
||||
bio: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
|
||||
# Relationships
|
||||
articles: Mapped[list["Article"]] = relationship("Article", back_populates="author")
|
||||
Reference in new issue
Block a user