当前位置: 首页>>代码示例>>Python>>正文


Python decorators.view函数代码示例

本文整理汇总了Python中soc.views.helper.decorators.view函数的典型用法代码示例。如果您正苦于以下问题:Python view函数的具体用法?Python view怎么用?Python view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了view函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

        'nr_applications' : len(org_apps),
        'application_type' : params['name_plural'],
        'applications': org_apps,
        'link' : '/%s/review/%s/(link_id)?status=%s' %(
            params['url_name'] ,program_entity.key().id_or_name(), to_status),
        }

    json = simplejson.dumps(to_json)

    # use the standard JSON template to return our response
    context = {'json': json}
    template = 'soc/json.html'

    return responses.respond(request, template, context)


view = View()

admin = decorators.view(view.admin)
bulk_accept = decorators.view(view.bulkAccept)
bulk_reject = decorators.view(view.bulkReject)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
list_self = decorators.view(view.listSelf)
public = decorators.view(view.public)
export = decorators.view(view.export)
review = decorators.view(view.review)
review_overview = decorators.view(view.reviewOverview)
开发者ID:ajaksu,项目名称:Melange,代码行数:30,代码来源:org_app.py

示例2: View

          {'url_name': 'host'}), 
          "Resign as Program Administrator", 'any_access')
      submenus.append(submenu)

      # add a link to create a new document
      submenu = (redirects.getCreateDocumentRedirect(group_entity, 'sponsor'),
          "Create a New Document", 'any_access')
      submenus.append(submenu)

      # add a link to list all documents
      submenu = (redirects.getListDocumentsRedirect(group_entity, 'sponsor'),
          "List Documents", 'any_access')
      submenus.append(submenu)

    return submenus


view = View()

admin = decorators.view(view.admin)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
home = decorators.view(view.home)
list = decorators.view(view.list)
list_requests = decorators.view(view.listRequests)
list_roles = decorators.view(view.listRoles)
public = decorators.view(view.public)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
开发者ID:ajaksu,项目名称:Melange,代码行数:30,代码来源:sponsor.py

示例3: super

    rights = access.Checker(params)

    new_params = {}
    new_params['rights'] = rights
    new_params['logic'] = job_logic

    new_params['name'] = "Job"

    new_params['no_create_raw'] = True
    new_params['no_create_with_scope'] = True
    new_params['no_create_with_key_fields'] = True

    new_params['extra_dynaexclude'] = ['key_data', 'text_data']

    new_params['edit_dynaproperties'] = {
      'task': forms.CharField(widget=widgets.PlainTextWidget()),
      }

    params = dicts.merge(params, new_params)

    super(View, self).__init__(params=params)


view = View()

delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
public = decorators.view(view.public)
开发者ID:ajaksu,项目名称:Melange,代码行数:29,代码来源:job.py

示例4: View

    Args:
        entity: the student project entity
        rest: see base.View.public()
    """

    form = params['student_edit_form'](request.POST)

    if not form.is_valid():
      return self._constructResponse(request, entity, context, form, params)

    _, fields = forms_helper.collectCleanedFields(form)

    project_logic.updateEntityProperties(entity, fields)

    return self.stEditGet(request, context, params, entity, **kwargs)


view = View()

admin = decorators.view(view.admin)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
manage = decorators.view(view.manage)
manage_overview = decorators.view(view.manageOverview)
public = decorators.view(view.public)
st_edit = decorators.view(view.stEdit)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
开发者ID:jamslevy,项目名称:gsoc,代码行数:30,代码来源:student_project.py

示例5: View

    followers = review_follower_logic.getForFields(fields)

    if is_public:
      # redirect to public page
      redirect_url = redirects.getPublicRedirect(entity, self._params)
    else:
      # redirect to review page
      redirect_url = redirects.getReviewRedirect(entity, self._params)

    for follower in followers:
      # sent to every follower except the reviewer
      if follower.user.key() != review_entity.author.key():
        notifications_helper.sendNewReviewNotification(follower.user,
            review_entity, entity.title, redirect_url)


view = View()

admin = decorators.view(view.admin)
apply = decorators.view(view.apply)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
list_orgs = decorators.view(view.listOrgs)
list_self = decorators.view(view.listSelf)
public = decorators.view(view.public)
review = decorators.view(view.review)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
开发者ID:jamslevy,项目名称:gsoc,代码行数:30,代码来源:student_proposal.py

示例6: super

    new_params['name'] = "GSoC Mentor"
    new_params['module_name'] = "mentor"
    new_params['sidebar_grouping'] = 'Organizations'

    new_params['module_package'] = 'soc.modules.gsoc.views.models'
    new_params['url_name'] = 'gsoc/mentor'

    new_params['role'] = 'gsoc/mentor'

    params = dicts.merge(params, new_params, sub_merge=True)

    super(View, self).__init__(params)


view = View()

accept_invite = decorators.view(view.acceptInvite)
admin = decorators.view(view.admin)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
invite = decorators.view(view.invite)
list = decorators.view(view.list)
manage = decorators.view(view.manage)
process_request = decorators.view(view.processRequest)
role_request = decorators.view(view.request)
public = decorators.view(view.public)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
开发者ID:SRabbelier,项目名称:Melange,代码行数:29,代码来源:mentor.py

示例7: View

    except out_of_band.Error, error:
      return responses.errorResponse(
          error, request, template=params['error_public'])

    list_params = params.copy()
    list_params['logic'] = record_logic
    list_params['records_row_extra'] = lambda entity: {
        'link': redirects.getEditGradingRecordRedirect(entity, list_params)
    }
    list_params['records_row_action'] = params['public_row_action']
    fields = {'grading_survey_group': survey_group}

    # get the list content for all records
    list_params['list_description'] = \
        'List of all GradingRecords. Pick one to edit it.'

    # return the view which renders the set content
    return self.list(request, 'allow', page_name=page_name,
                     params=list_params, visibility='records')


view = View()

create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
edit_record = decorators.view(view.editRecord)
list = decorators.view(view.list)
public = decorators.view(view.public)
view_records = decorators.view(view.viewRecords)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:grading_survey_group.py

示例8: super

    new_params['logic'] = org_app_logic
    new_params['rights'] = rights

    new_params['scope_view'] = program_view

    new_params['name'] = "GCI Org Application Survey"
    new_params['url_name'] = 'gci/org_app'
    new_params['module_package'] = 'soc.modules.gci.views.models'
    new_params['module_name'] = 'org_app_survey'

    new_params['bulk_process_task'] = org_app_survey_tasks.bulk_process

    params = dicts.merge(params, new_params, sub_merge=True)

    super(View, self).__init__(params=params)


view = View()

create = decorators.view(view.create)
edit = decorators.view(view.edit)
delete = decorators.view(view.delete)
list = decorators.view(view.list)
list_self = decorators.view(view.listSelf)
public = decorators.view(view.public)
record = decorators.view(view.viewRecord)
results = decorators.view(view.viewResults)
review = decorators.view(view.review)
review_overview = decorators.view(view.reviewOverview)
take = decorators.view(view.take)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:org_app_survey.py

示例9: View

    order = ['-points']

    if lists.isDataRequest(request):
      contents = lists.getListData(request, list_params, ranking_filter)
      return lists.getResponse(request, contents)

    contents = [lists.getListGenerator(
        request, list_params, order=order, idx=0)]

    return self._list(request, list_params, contents=contents,
        page_name=page_name)

view = View()

admin = decorators.view(view.admin)
accepted_orgs = decorators.view(view.acceptedOrgs)
assign_task_quotas = decorators.view(view.assignTaskQuotas)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
list_my_tasks = decorators.view(view.listMyTasks)
list_participants = decorators.view(view.listParticipants)
list_tasks = decorators.view(view.listTasks)
public = decorators.view(view.public)
request_tasks = decorators.view(view.requestMoreTasks)
show_ranking = decorators.view(view.showRanking)
export = decorators.view(view.export)
home = decorators.view(view.home)
task_type_tag_edit = decorators.view(view.taskTypeTagEdit)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:program.py

示例10: TODO

            return http.HttpResponseRedirect(gci_redirects.getSubmitFormsRedirect(entity, params))

        # TODO(SRabbelier): handle multiple file uploads
        upload = request.file_uploads[0]

        if form == "consent":
            entity.consent_form = upload
        elif form == "consent_two":
            entity.consent_form_two = upload
        elif form == "student_id":
            entity.student_id_form = upload
        else:
            logging.warning("Invalid value for form '%s'" % form)

        entity.put()

        return http.HttpResponseRedirect(gci_redirects.getSubmitFormsRedirect(entity, params))


view = View()

apply = decorators.view(view.apply)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
public = decorators.view(view.public)
export = decorators.view(view.export)
submit_forms = decorators.view(view.submitForms)
download_blob = decorators.view(view.downloadBlob)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:student.py

示例11: super

    new_params['url_name'] = "club_app"
    new_params['group_name'] = "Club"
    new_params['group_url_name'] = 'club'

    new_params['review_template'] = 'soc/club_app/review.html'

    new_params['sidebar_additional'] = [
        ('/%(url_name)s/list_self/' % new_params,
         'List all my %(name_plural)s' % new_params, 'list_self'),
        ('/%(url_name)s/review_overview/' % new_params,
         'Review %(name_plural)s' % new_params, 'review_overview')]

    params = dicts.merge(params, new_params)

    super(View, self).__init__(params=params)


view = View()

admin = decorators.view(view.admin)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
list = decorators.view(view.list)
list_self = decorators.view(view.listSelf)
public = decorators.view(view.public)
export = decorators.view(view.export)
review = decorators.view(view.review)
review_overview = decorators.view(view.reviewOverview)

开发者ID:ajaksu,项目名称:Melange,代码行数:29,代码来源:club_app.py

示例12: View

        if request_status != request_entity.status:
          request_logic.updateEntityProperties(request_entity, {
              'status': get_dict['status']})

        group_view = params.get('group_view')
        if not group_view:
          return http.HttpResponseRedirect('/')
        else:
          # redirect to the requests list
          return http.HttpResponseRedirect(
              redirects.getListRequestsRedirect(request_entity.group,
                  group_view.getParams()))

    # put the entity in the context
    context['entity'] = request_entity
    context['request_status'] = request_entity.status 
    context['role_verbose'] = params['name']
    context['url_name'] = params['url_name']

    #display the request processing page using the appropriate template
    template = request_view.view.getParams()['request_processing_template']

    return responses.respond(request, template, context=context)


view = View()

create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:role.py

示例13: super

    rights['any_access'] = ['allow']
    rights['download_blob'] = ['allow']

    new_params = {}
    new_params['logic'] = soc.modules.gci.logic.models.work_submission.logic
    new_params['rights'] = rights

    new_params['name'] = "Work Submission"
    new_params['module_name'] = "work_submission"

    new_params['module_package'] = 'soc.modules.gci.views.models'
    new_params['url_name'] = 'gci/work_submission'

    patterns = []
    patterns += [
        (r'^%(url_name)s/(?P<access_type>download_blob)$',
        '%(module_package)s.%(module_name)s.download_blob',
        'Download the blob'),
        ]

    new_params['extra_django_patterns'] = patterns

    params = dicts.merge(params, new_params, sub_merge=True)

    super(View, self).__init__(params=params)


view = View()

download_blob = decorators.view(view.downloadBlob)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:work_submission.py

示例14: TODO

    entity = None

    # TODO(ajaksu): there has to be a better way in this universe to get these
    kwargs['prefix'] = 'program'
    kwargs['link_id'] = request.path.split('/')[-1]
    kwargs['scope_path'] = '/'.join(request.path.split('/')[4:-1])

    entity = survey_logic.getFromKeyFieldsOr404(kwargs)

    if not self._public(request, entity, context):
      error = out_of_band.Error('')
      error = responses.errorResponse(
          error, request, template=params['error_public'], context=context)
      return error, None

    return entity, context


view = View()

admin = decorators.view(view.admin)
create = decorators.view(view.create)
edit = decorators.view(view.edit)
delete = decorators.view(view.delete)
list = decorators.view(view.list)
public = decorators.view(view.public)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
results = decorators.view(view.viewResults)
json = decorators.view(view.exportSerialized)
开发者ID:ajaksu,项目名称:Melange,代码行数:30,代码来源:survey.py

示例15: super

    """

    new_params = {}

    new_params['url_name'] = 'gsoc/statistic'
    new_params['module_name'] = 'gsoc_statistic'
    new_params['program_logic'] = gsoc_program_logic

    params = dicts.merge(params, new_params)

    super(View, self).__init__(params=params)


view = View()

manage_statistics = view_decorators.view(view.manageStatistics)
csv_export = view_decorators.view(view.csvExport)
manage_statistics = view_decorators.view(view.manageStatistics)
update_stats = view_decorators.view(view.updateOrClearStats)
visualize = view_decorators.view(view.visualize)
get_json_response = view_decorators.view(view.getJsonResponse)
get_virtual_statistics = view_decorators.view(view.getVirtualStatistics)
get_available_statistics = view_decorators.view(view.getAvailableStatistics)
set_collect_task = view_decorators.view(view.setCollectTask)
public = view_decorators.view(view.public)
create = view_decorators.view(view.create)
delete = view_decorators.view(view.delete)
edit = view_decorators.view(view.edit)
list = view_decorators.view(view.list)
collect_task = task_decorators.task(view.collectTask)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:gsoc_statistic.py


注:本文中的soc.views.helper.decorators.view函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。