from datetime import datetime

from sqlalchemy import Column, DateTime, Integer, String, Unicode

from flexget.manager import Base


class History(Base):
    __tablename__ = 'history'

    id = Column(Integer, primary_key=True)
    task = Column('feed', String)
    filename = Column(String)
    url = Column(String)
    title = Column(Unicode)
    time = Column(DateTime)
    details = Column(String)

    def __init__(self):
        self.time = datetime.now()

    def __str__(self):
        return '<History(filename=%s,task=%s)>' % (self.filename, self.task)

    def to_dict(self):
        return {
            'id': self.id,
            'task': self.task,
            'filename': self.filename,
            'url': self.url,
            'title': self.title,
            'time': self.time.isoformat(),
            'details': self.details,
        }

054cff179829000a0b3b9e823c9b7d358cc4321c
<mask token>


class History(Base):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self):
        self.time = datetime.now()
    <mask token>

    def to_dict(self):
        return {'id': self.id, 'task': self.task, 'filename': self.filename,
            'url': self.url, 'title': self.title, 'time': self.time.
            isoformat(), 'details': self.details}

<mask token>


class History(Base):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __init__(self):
        self.time = datetime.now()

    def __str__(self):
        return '<History(filename=%s,task=%s)>' % (self.filename, self.task)

    def to_dict(self):
        return {'id': self.id, 'task': self.task, 'filename': self.filename,
            'url': self.url, 'title': self.title, 'time': self.time.
            isoformat(), 'details': self.details}

<mask token>


class History(Base):
    __tablename__ = 'history'
    id = Column(Integer, primary_key=True)
    task = Column('feed', String)
    filename = Column(String)
    url = Column(String)
    title = Column(Unicode)
    time = Column(DateTime)
    details = Column(String)

    def __init__(self):
        self.time = datetime.now()

    def __str__(self):
        return '<History(filename=%s,task=%s)>' % (self.filename, self.task)

    def to_dict(self):
        return {'id': self.id, 'task': self.task, 'filename': self.filename,
            'url': self.url, 'title': self.title, 'time': self.time.
            isoformat(), 'details': self.details}

from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String, Unicode
from flexget.manager import Base


class History(Base):
    __tablename__ = 'history'
    id = Column(Integer, primary_key=True)
    task = Column('feed', String)
    filename = Column(String)
    url = Column(String)
    title = Column(Unicode)
    time = Column(DateTime)
    details = Column(String)

    def __init__(self):
        self.time = datetime.now()

    def __str__(self):
        return '<History(filename=%s,task=%s)>' % (self.filename, self.task)

    def to_dict(self):
        return {'id': self.id, 'task': self.task, 'filename': self.filename,
            'url': self.url, 'title': self.title, 'time': self.time.
            isoformat(), 'details': self.details}

from datetime import datetime

from sqlalchemy import Column, DateTime, Integer, String, Unicode

from flexget.manager import Base


class History(Base):
    __tablename__ = 'history'

    id = Column(Integer, primary_key=True)
    task = Column('feed', String)
    filename = Column(String)
    url = Column(String)
    title = Column(Unicode)
    time = Column(DateTime)
    details = Column(String)

    def __init__(self):
        self.time = datetime.now()

    def __str__(self):
        return '<History(filename=%s,task=%s)>' % (self.filename, self.task)

    def to_dict(self):
        return {
            'id': self.id,
            'task': self.task,
            'filename': self.filename,
            'url': self.url,
            'title': self.title,
            'time': self.time.isoformat(),
            'details': self.details,
        }
