Skip to content

how to create a module-based API #31

@faassen

Description

@faassen

Dectate is written around app class driven APIs such as used in Morepath. This gives you special features like inheritance and overrides. But what if you want to give a decorator-based API to something that already exists? If there is no clear "registry" concept you can associate with an app class those features of Dectate are not useful anyway. You can still use Dectate for the directive ordering and conflict detection and so on.

You can in this case expose a module API like this:

class HiddenApp(dectate.App):
    pass

some_directive = HiddenApp.some_directive
commit = HiddenApp.commit

We should document this and ideally offer some automation so that this is done by itself. Or would it be enough to simply expose HiddenApp as a pretend module you can use?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions