25 lines
943 B
Python
25 lines
943 B
Python
import sqlalchemy
|
|
from sqlalchemy import Index
|
|
from sqlalchemy.orm import relationship, backref
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
from src.ORM_modules.base import Base, NgoBase
|
|
|
|
|
|
class Event(Base, NgoBase):
|
|
#__tablename__ = 'events'
|
|
|
|
EID = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, nullable=False)
|
|
ETitle = sqlalchemy.Column(sqlalchemy.String(length=255), nullable=False)
|
|
Edate = sqlalchemy.Column(sqlalchemy.String(length=255), nullable=False)
|
|
EUrl = sqlalchemy.Column(sqlalchemy.String(length=255), nullable=True)
|
|
|
|
#organisation = relationship('Organisation', secondary='TOrganisation_Events')
|
|
def getIndex(self):
|
|
return self.EID
|
|
|
|
__table_args__ = (Index('ETitle', "ETitle", "Edate", "EUrl"), )
|
|
|
|
def __repr__(self):
|
|
return "<Event(name='{0}', fullname='{1}', nickname='{2}')>".format(
|
|
self.ETitle, self.Edate, self.EUrl)
|