27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
import sqlalchemy
|
|
from sqlalchemy import Index, ForeignKey
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
from src.ORM_modules.base import Base
|
|
from src.ORM_modules.Event import Event
|
|
from sqlalchemy.orm import relationship, backref
|
|
from src.ORM_modules.Organisation import Organisation
|
|
|
|
class Organisation_Events(Base):
|
|
__tablename__ = 'TOrganisation_Events'
|
|
|
|
#OEID = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, nullable=False)
|
|
FK_EID = sqlalchemy.Column(sqlalchemy.Integer, ForeignKey("event.EID",onupdate="CASCADE", ondelete="CASCADE"), nullable=False, primary_key=True)
|
|
FK_OID = sqlalchemy.Column(sqlalchemy.Integer, ForeignKey("organisation.OID",onupdate="CASCADE", ondelete="CASCADE"), nullable=False, primary_key=True)
|
|
rrel = relationship(Event, backref=backref("event_assoc"))
|
|
lrel = relationship(Organisation, backref=backref("organisation_assoc"))
|
|
def __repr__(self):
|
|
return ""
|
|
@classmethod
|
|
def getLeftFK(cls):
|
|
return Organisation_Events.FK_OID
|
|
@classmethod
|
|
def getRightFK(cls):
|
|
return Organisation_Events.FK_EID
|
|
|
|
|