def _save_associate_deployment(form, d): d.name = form.cleaned_data['name'] d.slug = _slugit(Deployment, d.name) d.provider = form.cleaned_data['provider'] d.project = form.cleaned_data['project'] d.username = form.cleaned_data['username'] d.ip_address = form.cleaned_data['ip_address'] d.ssh_port = form.cleaned_data['ssh_port'] d.save()
def feedback(req): if req.method == 'GET': p = {'excellian': req.user.get_profile(), 'is_feedback': True, 'feedback': Feedback.objects.all().order_by('-message_date')} p.update(csrf(req)) return render_to_response(TEMPLATE_PATH + "feedback.html", p, context_instance=RequestContext(req)) elif req.method == 'POST': feedback = Feedback() feedback.excellian = req.user.get_profile() feedback.message = req.POST.get('message', '').strip() feedback.slug = _slugit(Feedback, feedback.message) if feedback.message == '': return _jsonResponse('Please enter a feedback message.') feedback.save() messages.add_message(req, messages.INFO, 'Feedback received. Thanks!') return _jsonResponse({'redirect': '/feedback/'})
def _save_project(form, p): p.name = form.cleaned_data["name"] p.slug = _slugit(Project, p.name) p.repository_url = form.cleaned_data["repository_url"] p.production_url = form.cleaned_data["production_url"] p.save()
def _save_research_link(form, l): l.name = form.cleaned_data['name'] l.slug = _slugit(ResearchLink, l.name) l.link_url = form.cleaned_data['link_url'] l.save()
def _save_idea(form, i): i.name = form.cleaned_data['name'] i.slug = _slugit(Idea, i.name) i.concept = form.cleaned_data['concept'] i.save()