[housing] adding a url field in housing capability and management of it in flatboob

This commit is contained in:
Bezleputh 2014-10-07 16:06:39 +02:00
commit 77995378c5
2 changed files with 6 additions and 1 deletions

View file

@ -34,6 +34,10 @@ class HousingFormatter(IFormatter):
def format_obj(self, obj, alias):
result = u'%s%s%s\n' % (self.BOLD, obj.title, self.NC)
result += 'ID: %s\n' % obj.fullid
if hasattr(obj, 'url') and obj.url:
result += 'URL: %s\n' % obj.url
result += 'Cost: %s%s\n' % (obj.cost, obj.currency)
result += u'Area: %s\n' % (obj.area)
if obj.date:
@ -56,6 +60,7 @@ class HousingFormatter(IFormatter):
result += '\n\n%sDetails%s\n' % (self.BOLD, self.NC)
for key, value in obj.details.iteritems():
result += ' %s: %s\n' % (key, value)
return result

View file

@ -61,7 +61,7 @@ class Housing(BaseObject):
phone = StringField('Phone number to contact')
photos = Field('List of photos', list)
details = Field('Key/values of details', dict)
url = StringField('Url of the the advert')
class Query(BaseObject):
"""