Example #1
0
    def update(**kwargs):
        contact = Contact.get(kwargs['id'])
        for key in kwargs:
            contact.__setattr__(key, kwargs[key])

        meta.Session.commit()
        session.save()
        
        contact_type = Contact_type.get(kwargs['typeid'])
        index_update = IndexUpdate()
        index_update.updateItem('contact', kwargs['id'])
        index_update.updateData(kwargs['label'] + ' ' + str(kwargs['description']) + ' ' + str(contact_type.label))
        index_update.update()
Example #2
0
 def update(**kwargs):
     tenant = Tenant.get(kwargs['id'])
     
     for key in kwargs:
         tenant.__setattr__(key, kwargs[key])
     
     meta.Session.commit()
     session.save()
     
     text = ' '.join([tenant.first_name, tenant.last_name])
     index_update = IndexUpdate()
     index_update.updateItem('tenant', kwargs['id'])
     index_update.updateData(text)
     index_update.update()
Example #3
0
 def rename(newlabel, unitid):
     
     from rentfox.model.property import Property
     
     unit = meta.Session.query(Unit).filter(Unit.deleted==None).filter_by(id=unitid).first()
     unit.label = newlabel
     
     meta.Session.commit()
     session.save()
     
     # update index
     property = Property.get_property(unit.propertyid)
     text = ' '.join([str(newlabel), str(newlabel), str(newlabel), str(property.name), str(property.address)])
     index_update = IndexUpdate()
     index_update.updateItem('unit', unitid)
     index_update.updateData(text)
     index_update.update()