from ulitanzen.extensions import db
from datetime import datetime
from collections import OrderedDict

class Event(db.Model):
    __tablename__ = 'events'
    
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(80))
    description = db.Column(db.String(300))
    start_date = db.Column(db.DateTime)
    end_date = db.Column(db.DateTime)
	
    def __init__(self, title, description, start_date, end_date):
        self.title = title
        self.description = description
        self.start_date = start_date
        self.end_date = end_date

    def dict(self):
        return OrderedDict(id=self.id, title=self.title)