def create(request, proj_id):
    
    project = get_object_or_404(Project, pk=proj_id)
    
    # require permission to proceed
    must_have_permission(request.user, project, "can_create_roles")
    
    obj_permissions = ObjectPermission.objects.filter_from_instance(project)
    
    project_url = reverse("project_detail", args=[project.id])
    
    def pre_save(instance, created):
        instance.project = project
    
    return generic_crud(
        request,
        obj_id=None,
        model=ProjectRole,
        template=TEMPLATE_PATH+"/create.html",
        redirect=lambda instance: project_url,
        form_class=ProjectRoleForm,
        pre_save=pre_save,
        extra_form_params={
            "obj_permissions": obj_permissions,
        },
        extra_context={
            "project": project,
            "breadcrumbs": (
                ("Home", reverse("home")),
                ("Project %s" % project.name,
                 project_url),
                ("Create Role", request.path),
            )
        }
    )
Returns a formatted dictionary for the given action.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/clearinghouse/roles/views.py/create--crossover with--dataset/ETHPy150Open justquick/django-activity-stream/actstream/feeds.py/AbstractActivityStream.format