In the Django property app, we add to /path/to/repo/www/chapter_08/property/views.py a view method, listProp(), that accepts a property key as an argument. If the property key is present, we use the property domain service to retrieve a Property entity instance:
def listProp(request, prop_key = None) :
propSvc = PropertyService(Config())
prop = Property()
rooms = []
message = ''
if prop_key :
prop = propSvc.fetchByKey(prop_key)
# build master form
We are now in a position to render the form:
info = prop.get('propInfo')
context = {
'message' : message,
'prop_name' : prop.get('propName'),
'prop_type' : info.get('type'),
'prop_des' : info.get('description'),
'prop_key' : prop_key,
}
prop_master = render_to_string('property_list.html', context)
page = render_to_string...