• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python decorators.view函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: super

    form.fields['agreed_to_tos_on'].example_text = self._getToSExampleText()
    form.fields['status'].initial = entity.status

    super(View, self)._editGet(request, entity, form)


  def _getToSExampleText(self):
    """Returns example_text linking to site-wide ToS, or a warning message.
    """
    tos_link = redirects.getToSRedirect(site_logic.getSingleton())

    if not tos_link:
      return ('<div class="notice">&nbsp;<i>No site-wide</i> Terms of'
              ' Service <i>are currently set!</i>&nbsp;</div>')

    return ('<i>current site-wide <b><a href=%s>Terms of Service</a></b></i>'
            % tos_link)


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_developers = decorators.view(view.listDevelopers)
public = decorators.view(view.public)
export = decorators.view(view.export)
pick = decorators.view(view.pick)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:user.py


示例17: View

    This view is accessed by an AJAX call from task public page.

    Args:
      request: the standard Django HTTP request object
    """

    data = None
    get_params = request.GET

    task_entity = gci_task_logic.logic.getFromKeyNameOr404(
        get_params['key_name'])
    user_entity = user_logic.logic.getCurrentUser()

    # this method gets called everytime the task public page gets loaded
    # caused by jQuery. So this conditional is necessary to make sure
    # toggling won't happen every time task public page is loaded but
    # only when subscription star is clicked
    if not get_params.get('no_toggle'):
      data = params['logic'].subscribeUser(
          task_entity, user_entity, toggle=True)
    else:
      data = params['logic'].subscribeUser(
          task_entity, user_entity, toggle=False)

    return http.HttpResponse(data if data else '')


view = View()

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


示例18: getListRankingDetailsData

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


  def getListRankingDetailsData(self, request, params, student):
    """Returns the list data for Ranking Details list.

    Args:
      request: HTTPRequest object
      params_collection: List of list Params indexed with the idx of the list
      org_entity: GCIOrganization entity for which the lists are generated
    """

    filter = {
        'student': student,
        'status': 'Closed',
        }

    visibility = 'public'
    args = []

    params['logic'] = gci_task_logic

    contents = lists.getListData(request, params, filter,
        visibility=visibility, args=args)
    return lists.getResponse(request, contents)

view = View()

show_details = decorators.view(view.showDetails)
开发者ID:SRabbelier,项目名称:Melange,代码行数:29,代码来源:student_ranking.py


示例19: View

    """Displays the edit page for the main site settings page.

    Args:
      request: the standard Django HTTP request object
      page_name: the page name displayed in templates as page and header title
      kwargs: not used
    """

    keys = self._logic.getKeyFieldNames()

    # No entity in this case, since Site key values are hard-coded for the
    # Site singleton, so pass in None to match parent method footprint.
    values = self._logic.getKeyValuesFromEntity(None)
    key_values = dicts.zip(keys, values)

    return self.edit(request, "edit", page_name, seed=key_values, **key_values)


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)
main_public = decorators.view(view.mainPublic)
main_edit = decorators.view(view.mainEdit)
home = decorators.view(view.home)
开发者ID:ajaksu,项目名称:Melange,代码行数:30,代码来源:site.py


示例20: View

                "any_access",
            )
            submenus.append(submenu)

            # add a link to the edit page
            submenu = (
                redirects.getEditRedirect(roles["gci_mentor"], {"url_name": "gci/mentor"}),
                "Edit My Mentor Profile",
                "any_access",
            )
            submenus.append(submenu)

        return submenus


view = View()

admin = decorators.view(view.admin)
applicant = decorators.view(view.applicant)
apply_mentor = decorators.view(view.applyMentor)
create = decorators.view(view.create)
delete = decorators.view(view.delete)
edit = decorators.view(view.edit)
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)
home = decorators.view(view.home)
request_task = decorators.view(view.requestTask)
开发者ID:SRabbelier,项目名称:Melange,代码行数:30,代码来源:organization.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lists.getListIndex函数代码示例发布时间:2022-05-27
下一篇:
Python access_checker.isSet函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap