Пример #1
0
 def is_relevant(result):
     return (
         result.base_rent <= self.max_rent
         and result.room_count >= self.min_room_count
         and result.room_count <= self.max_room_count
         and (
             not result.geolocation
             or (result.geolocation and geoutils.direct_distance(self.near, result.geolocation) <= self.max_distance)
         )
         and result.size >= self.min_size
     )
Пример #2
0
 def is_relevant(result):
     return (
         result.base_rent <= self.max_rent
         and result.total_rent <= self.max_rent
         and result.room_count >= self.min_room_count
         and result.room_count <= self.max_room_count
         and (
             not result.geolocation
             or (result.geolocation and geoutils.direct_distance(self.near, result.geolocation) <= self.max_distance)
         )
         and (result.commute_duration <= self.max_commute_duration or not result.commute_duration or not self.max_commute_duration)
         and result.size >= self.min_size
         and result.date_published > self.published_after
         and (result.floor == result.floor_count or not self.top_floor_only or not result.floor_count)
     )