Beispiel #1
0
 def __json__(self):
     movie = Movie.query.get(self.movieId)
     return {
         'movieId': self.movieId,
         'poster': '/static/images/poster/%s' % movie.poster,
         'playingTime': time2stamp(movie.playingTime)
     }
Beispiel #2
0
 def __json__(self):
     return {
         'id': self.id,
         'discount': self.discount,
         'condition': self.condition,
         'expiredTime': time2stamp(self.expiredTime),
         'status': self.status
     }
Beispiel #3
0
 def __json__(self):
     screen = Screen.query.get(self.screenId)
     movie = Movie.query.get(screen.movieId)
     return {
         'id': self.id,
         'screenId': self.screenId,
         'movieId': movie.id,
         'duration': movie.duration,
         'name': movie.name,
         'screenTime': time2stamp(screen.time),
         'createTime': time2stamp(self.createTime),
         'username': self.username,
         'seat': self.seat,
         'status': self.status,
         'couponId': self.couponId,
         'payPrice': self.payPrice,
         'totalPrice': self.totalPrice
     }
Beispiel #4
0
 def __json__(self):
     movie = Movie.query.get(self.movieId)
     return {
         'id': self.id,
         'movie': movie.__json__(),
         'time': time2stamp(self.time),
         'price': self.price,
         'ticketNum': self.ticketNum,
         'hallNum': self.hallNum,
         'playingType': movie.playingType
     }
Beispiel #5
0
 def __json__(self):
     return {
         'id': self.id,
         'name': self.name,
         'poster': '/static/images/poster/%s' % self.poster,
         'movieType': self.movieType,
         'playingType': self.playingType,
         'playingTime': time2stamp(self.playingTime),
         'duration': self.duration,
         'rating': self.rating,
         'description': self.description,
         'ratingNum': self.ratingNum
     }
Beispiel #6
0
def AsMinutes():
    airports_csv_in = Path(args.airports_csv_in)
    df = pd.read_csv(airports_csv_in, delimiter='\t')
    df['timestamp'] = df['CREATEDATE'].apply(lambda c: time2stamp(c))
    itelist = []
    for idx, row in df.iterrows():
        if row['timestamp'] not in itelist:
            itelist.append(row['timestamp'])
        else:
            df['timestamp'][idx] = -1

    df = df.query('timestamp!=-1')

    df.to_csv(args.airports_csv_out, index=False, sep='\t')