add housing photos
This commit is contained in:
parent
81bf44cec6
commit
0c522d948a
4 changed files with 41 additions and 5 deletions
|
|
@ -68,7 +68,13 @@ class SeLogerBackend(BaseBackend, ICapHousing):
|
|||
|
||||
def fill_housing(self, housing, fields):
|
||||
with self.browser:
|
||||
return self.browser.get_housing(housing.id)
|
||||
if fields != ['photos'] or not housing.photos:
|
||||
housing = self.browser.get_housing(housing.id)
|
||||
if 'photos' in fields:
|
||||
for photo in housing.photos:
|
||||
if not photo.data:
|
||||
photo.data = self.browser.readurl(photo.url)
|
||||
return housing
|
||||
|
||||
OBJECTS = {Housing: fill_housing,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue