コード例 #1
0
ファイル: property.py プロジェクト: weixiyen/Rentfox
 def delete(propertyid):
     from rentfox.model.pulse import Pulse
     from rentfox.model.lease import Lease
     from rentfox.model.contact_type import Contact_type
     
     property = Property.get_property(propertyid)
     recycleId = Recycle.create("Property deleted: {0}".format(property.name))
     
     #set property, units, floorplans to deleted
     property.deleted = recycleId
     Unit.deleteByPropertyId(propertyid, recycleId)
     Floorplan.deleteByPropertyId(propertyid, recycleId)
     Lease.deleteByPropertyId(propertyid, recycleId)
     
     meta.Session.commit()
     session.save()
     
     index_update = IndexUpdate()
     index_update.updateItem('property', propertyid)
     index_update.updateTerm('deleted', 0, recycleId)
     index_update.update()