As we mentioned, this process is similar to the process needed to update property contact information. Accordingly, we can simply copy the already existing view and template code from the update contact logic and merge it with the logic needed to list a property. In the Django property app, we add the delProperty() method to views.py. We start by initializing variables:
def delProperty(request) :
propSvc = PropertyService(Config())
prop = Property()
rooms = []
message = ''
confirm = False
prop_key = ''
Next, we check to see if a property has been chosen:
if request.method == 'POST' :
if 'prop_propertyKey' in request.POST :
prop_key = request.POST['prop_propertyKey']
prop = propSvc.fetchByKey(prop_key)
if prop :
confirm = True
message = 'Confirm property to delete'
If the prop_propertyKey...