from app import db


class Base(db.Model):

    __abstract__ = True

    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())


class Route(Base):

    __tablename__ = 'routes'

    origin_point = db.Column(db.String(128), nullable=False)
    destination_point = db.Column(db.String(128), nullable=False)
    distance = db.Column(db.Integer, nullable=False)

    def __init__(self, origin_point, destination_point, distance):
        self.origin_point = origin_point
        self.destination_point = destination_point
        self.distance = distance

    def __repr__(self):
        return '<Route <{0}-{1}-{2]>'.format(self.origin_pint,
                                             self.destination_point,
                                             self.distance)

from app import db


class Base(db.Model):

    __abstract__ = True

    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())


class Route(Base):

    __tablename__ = 'routes'

    origin_point = db.Column(db.String(128), nullable=False)
    destination_point = db.Column(db.String(128), nullable=False)
    distance = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        return '<Route <{0}-{1}-{2]>'.format(self.origin_pint,
                                             self.destination_point,
                                             self.distance)

Remove unecessary initialization from Route model
Remove unecessary initialization from Route model

  from app import db
  
  
  class Base(db.Model):
  
      __abstract__ = True
  
      id = db.Column(db.Integer, primary_key=True)
      created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
      updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())
  
  
  class Route(Base):
  
      __tablename__ = 'routes'
  
      origin_point = db.Column(db.String(128), nullable=False)
      destination_point = db.Column(db.String(128), nullable=False)
      distance = db.Column(db.Integer, nullable=False)
  
-     def __init__(self, origin_point, destination_point, distance):
-         self.origin_point = origin_point
-         self.destination_point = destination_point
-         self.distance = distance
- 
      def __repr__(self):
          return '<Route <{0}-{1}-{2]>'.format(self.origin_pint,
                                               self.destination_point,
                                               self.distance)
  
Remove unecessary initialization from Route model
## Code Before:
from app import db


class Base(db.Model):

    __abstract__ = True

    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())


class Route(Base):

    __tablename__ = 'routes'

    origin_point = db.Column(db.String(128), nullable=False)
    destination_point = db.Column(db.String(128), nullable=False)
    distance = db.Column(db.Integer, nullable=False)

    def __init__(self, origin_point, destination_point, distance):
        self.origin_point = origin_point
        self.destination_point = destination_point
        self.distance = distance

    def __repr__(self):
        return '<Route <{0}-{1}-{2]>'.format(self.origin_pint,
                                             self.destination_point,
                                             self.distance)

## Instruction:
Remove unecessary initialization from Route model
## Code After:
from app import db


class Base(db.Model):

    __abstract__ = True

    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated_at = db.Column(db.DateTime, default=db.func.current_timestamp())


class Route(Base):

    __tablename__ = 'routes'

    origin_point = db.Column(db.String(128), nullable=False)
    destination_point = db.Column(db.String(128), nullable=False)
    distance = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        return '<Route <{0}-{1}-{2]>'.format(self.origin_pint,
                                             self.destination_point,
                                             self.distance)
