예제 #1
0
 def delete(id):
     entity = Facility.get(id)
     if (entity is None):
         raise ValueError("Facility does not exists")
     else:
         entity.active = False
         Facility.save(entity)
예제 #2
0
 def save(entity):
     if entity.key is None:
         entity = Facility.save(entity)
     else:
         current = Facility.get(entity.key.urlsafe())
         if current is not None:
             current.facility_name = entity.facility_name
             current.facility_address = entity.facility_address
             current.facility_zipcode = entity.facility_zipcode
             current.facility_state = entity.facility_state
             current.facility_city = entity.facility_city
             current.contact_name = entity.contact_name
             current.contact_email = entity.contact_email
             current.contact_phone = entity.contact_phone
             current.hours_of_operation = entity.hours_of_operation
             current.active = entity.active
             current.latitude = entity.latitude
             current.longitude = entity.longitude
             entity = Facility.save(entity)
         else:
             raise ValueError("Facility does not exists")
     return entity
예제 #3
0
 def get(id):
     return Facility.get(id)