def ClearStopTimes(self):
        """Remove all stop times from this trip.

    StopTime objects previously returned by GetStopTimes are unchanged but are
    no longer associated with this trip.
    """
        cursor = self._schedule._connection.cursor()
        StopTime.delete(cursor, tolerant=True, trip_id=self.trip_id)
示例#2
0
  def ClearStopTimes(self):
    """Remove all stop times from this trip.

    StopTime objects previously returned by GetStopTimes are unchanged but are
    no longer associated with this trip.
    """
    cursor = self._schedule._connection.cursor()
    StopTime.delete( cursor, tolerant=True, trip_id=self.trip_id )
示例#3
0
  def ReplaceStopTimeObject(self, stoptime, schedule=None):
    """Replace a StopTime object from this trip with the given one.

    Keys the StopTime object to be replaced by trip_id, stop_sequence
    and stop_id as 'stoptime', with the object 'stoptime'.
    """

    if stoptime._cursor_factory is None:
      stoptime._cursor_factory = schedule if schedule else self._schedule

    StopTime.delete( stoptime._cursor_factory.cursor(), 
                     trip_id=self.trip_id,
                     stop_sequence=stoptime.stop_sequence,
                     stop_id=stoptime.stop_id )

    stoptime.save( trip_id=self.trip_id )
    def ReplaceStopTimeObject(self, stoptime, schedule=None):
        """Replace a StopTime object from this trip with the given one.

    Keys the StopTime object to be replaced by trip_id, stop_sequence
    and stop_id as 'stoptime', with the object 'stoptime'.
    """

        if stoptime._cursor_factory is None:
            stoptime._cursor_factory = schedule if schedule else self._schedule

        StopTime.delete(stoptime._cursor_factory.cursor(),
                        trip_id=self.trip_id,
                        stop_sequence=stoptime.stop_sequence,
                        stop_id=stoptime.stop_id)

        stoptime.save(trip_id=self.trip_id)