Skip to content

Instantly share code, notes, and snippets.

View ods's full-sized avatar
🇺🇦
Stand with Ukraine

Denis Otkidach ods

🇺🇦
Stand with Ukraine
View GitHub Profile
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Link(Base):
__tablename__ = 'Link'
id = Column(Integer, primary_key=True)
doc_id = Column(Integer, ForeignKey('Doc.id'), nullable=False)
@ods
ods / test2.py
Last active January 1, 2016 07:19 — forked from anonymous/test2.py
registry = Registry()
ReplicatedModel = registry.multidb(
admin=AdminBase,
front=FrontBase,
)
@registry.model(ReplicatedModel)
def Media(models):