def show_conatct_as_sitter(request): contacts = Contact.objects.fiter(sitter = get_user(request)) contact_info = [] for contact in contacts: temp = {} temp['contact'] = contact temp['image'] = myModule.get_userimg_by_userobj(contact.owner) contact_info.append(temp)
def show_conatct_as_owner(request): contacts = Contact.objects.filter(owner = get_user(request)) contact_info = [] for contact in contacts: temp = contact.__dict__ temp['photo'] = myModule.get_userimg_by_userobj(contact.sitter) temp['sitter'] = myModule.get_userobj_by_name(contact.sitter) contact_info.append(temp) return render(request, 'contact/contact_list.html', { 'contacts':contact_info, 'owner_contact':True })
def show_conatct_as_sitter(request): contacts = Contact.objects.fiter(sitter=get_user(request)) contact_info = [] for contact in contacts: temp = {} temp['contact'] = contact temp['image'] = myModule.get_userimg_by_userobj(contact.owner) contact_info.append(temp) #return render(request, 'contact/contact_list.html', {contacts:contact_info}) # html만들고 주석 풀어줭 # 시터사진, 이름, 주소, pa if request.methos == 'POST': form = ReviewForm(request.POST) else: form = ReviewForm() return render(request, 'contact/review.html', {'form': form})