Skip to content

Question about multiple decorators #58

@tflorac

Description

@tflorac

Hi,
I created two new Python decorators in a Pyramid's project using Venusian to define custom views and add functionalities to them.
I can have several decorators for the same view:

    @page_config(name='myview.html', ...)
    @ajax_config(...)
    class MyViewClass(object):
        """My custon view class"""

My questions are :

  • how can I define decorators order? Actually, whatever order I use, "ajax_config" decorator is always called before "page_config"...
  • to avoid duplicates, is it possible in a decorator to get arguments defined in the previous decorator?

Best regards,
Thierry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions