mirror of
https://github.com/mariadb-corporation/dev-example-blog-samples.git
synced 2025-08-13 13:12:49 +00:00
14 lines
358 B
Python
14 lines
358 B
Python
from sqlalchemy import Column, String, Integer, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from base import Base
|
|
|
|
class Department(Base):
|
|
__tablename__ = 'departments'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
name = Column(String(length=50))
|
|
employees = relationship("Employee")
|
|
|
|
def __init__(self, name):
|
|
self.name = name |