def create(request, template='contacts/company/create.html'):

    user = request.user
    if not user.has_perm('add_company'):
        return HttpResponseForbidden()

    if request.method == 'POST':
        company_form = CompanyCreateForm(request.POST)
        if company_form.is_valid():
            c = company_form.save(commit=False)

            # TODO Make sure that the slug isn't already in the database
            if c.nickname:
                c.slug = slugify(c.nickname)
            else:
                c.slug = slugify(c.name)

            c.save()
            return HttpResponseRedirect(c.get_absolute_url())
        else:
            return HttpResponseServerError

    kwvars = {
        'form': CompanyCreateForm(request.POST)
    }

    return render_to_response(template, kwvars, RequestContext(request))
Retrieve information from the parse tree of a source file.
dataset/ETHPy150Open myles/django-contacts/src/contacts/views/company.py/create--crossover with--dataset/ETHPy150Open kdart/pycopia/QA/pycopia/getdocs.py/get_docs