[venusian] Question about multiple decorators

10 views
Skip to first unread message

Thierry Florac

unread,
Jun 21, 2018, 2:02:08 AM6/21/18
to pylons-...@googlegroups.com

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"...
  • in this example, "page_config" and "ajax_config" share some arguments (which are mainly predicates); to avoid duplicates, is it possible in a decorator to get arguments defined in the previous decorator?

Best regards,
Thierry

--
Reply all
Reply to author
Forward
0 new messages