Commit 3e1a8b73 authored by Bezleputh's avatar Bezleputh

[CapHousing] add and handle in leboncoin a new house type : UNKNOWN

parent 9c6b2b05
......@@ -67,7 +67,8 @@ class LeboncoinBackend(BaseBackend, CapHousing):
ret = []
for g in query.house_types:
ret.append(self.RET.get(g))
if g in self.RET:
ret.append(self.RET.get(g))
if len(ret) == 0:
return list()
......
......@@ -85,7 +85,8 @@ class Query(BaseObject):
HOUSE=u'House',
PARKING=u'Parking',
LAND=u'Land',
OTHER=u'Other')
OTHER=u'Other',
UNKNOWN=u'Unknown')
type = IntField('Type of housing to find (TYPE_* constants)')
cities = Field('List of cities to search in', list, tuple)
......@@ -94,13 +95,7 @@ class Query(BaseObject):
cost_min = IntField('Minimal cost')
cost_max = IntField('Maximal cost')
nb_rooms = IntField('Number of rooms')
house_types = Field('List of house types', list, tuple)
def __init__(self):
BaseObject.__init__(self, '')
self.house_types = []
for value in self.HOUSE_TYPES.values:
self.house_types.append(value)
house_types = Field('List of house types', list, tuple, default=HOUSE_TYPES.values)
class City(BaseObject):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment