doc/api/__init__.rst
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 09 Mar 2017 16:36:33 +0100
changeset 12053 c3c9f2e1424c
parent 10494 b6f00889355c
permissions -rw-r--r--
[pyramid] Add a "pyramid" instance configuration type In a new module 'cubicweb.pyramid.config' we define a "pyramid" instance configuration type. The noticeable feature of this configuration is that it manages a 'development.ini' file that gets installed in application home (along with `.conf` file). This file is templated and includes generated values for secrets of session and authtk tokens. This means that we can just call: pserve etc/cubicweb.d/<appname>/development.ini or gunicorn --paste etc/cubicweb.d/<appname>/development.ini -b :8080 just after instance creation to get a pyramid instance running without having to hack around a 'pyramid.ini' file. This patch drops 'development.ini' from skeleton and moves it in cubicweb/pyramid so that it gets installed at instance creation which is more appropriate than in cube creation. The new configuration class sets "cubicweb.bwcompat" setting to false so it is not intended to replace the "all-in-one" configuration type (which would require a bit more work). This configuration is close to the the 'repository' configuration type with just a couple of options from WebConfiguration that are needed for Pyramid (anonymous user/password plus some miscellaneous options that I'm not so sure are really needed). Note, in particular, that we do not pull CORS settings to be injected as a WSGI middleware like in wsgi_application_from_cwconfig() since I believe this should be left as an end-user responsibility and since this can be defined in a standard way in paste configuration. This configuration inherits from ServerConfiguration but registers the same appobjects as WebConfiguration. In cubicweb.web.request._CubicWebRequestBase, we guard against access to "uiprops" and "datadir_url" of the config because this new "pyramid" config does not have these (this does not make sense without bwcompat mode). At some point, we should either avoid using `cw_request`'s pyramid request attribute or make cubicweb's web request really independant of existing implementation and drop these assumptions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10494
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     1
.. _index_module:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     2
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     3
:mod:`cubicweb`
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     4
===============
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     5
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     6
.. automodule:: cubicweb
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     7
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     8
    Exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     9
    ----------
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    10
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    11
    Base exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    12
    ~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    13
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    14
    .. autoexception:: ProgrammingError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    15
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    16
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    17
    .. autoexception:: CubicWebException
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    18
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    19
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    20
    .. autoexception:: InternalError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    21
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    22
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    23
    .. autoexception:: SecurityError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    24
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    25
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    26
    .. autoexception:: RepositoryError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    27
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    28
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    29
    .. autoexception:: SourceException
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    30
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    31
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    32
    .. autoexception:: CubicWebRuntimeError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    33
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    34
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    35
    Repository exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    36
    ~~~~~~~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    37
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    38
    .. autoexception:: ConnectionError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    39
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    40
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    41
    .. autoexception:: AuthenticationError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    42
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    43
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    44
    .. autoexception:: BadConnectionId
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    45
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    46
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    47
    .. autoexception:: UnknownEid
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    48
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    49
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    50
    .. autoexception:: UniqueTogetherError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    51
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    52
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    53
    Security Exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    54
    ~~~~~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    55
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    56
    .. autoexception:: Unauthorized
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    57
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    58
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    59
    .. autoexception:: Forbidden
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    60
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    61
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    62
    Source exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    63
    ~~~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    64
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    65
    .. autoexception:: EidNotInSource
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    66
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    67
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    68
    Registry exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    69
    ~~~~~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    70
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    71
    .. autoexception:: UnknownProperty
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    72
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    73
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    74
    Query exceptions
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    75
    ~~~~~~~~~~~~~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    76
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    77
    .. autoexception:: QueryError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    78
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    79
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    80
    .. autoexception:: NotAnEntity
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    81
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    82
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    83
    .. autoexception:: MultipleResultsError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    84
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    85
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    86
    .. autoexception:: NoResultError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    87
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    88
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    89
    .. autoexception:: UndoTransactionException
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    90
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    91
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    92
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    93
    Misc
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    94
    ~~~~
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    95
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    96
    .. autoexception:: ConfigurationError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    97
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    98
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    99
    .. autoexception:: ExecutionError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   100
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   101
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   102
    .. autoexception:: BadCommandUsage
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   103
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   104
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   105
    .. autoexception:: ValidationError
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   106
        :show-inheritance:
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   107
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   108
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   109
    Utilities
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   110
    ---------
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   111
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   112
    .. autoclass:: Binary
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   113
    .. autoclass:: CubicWebEventManager
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   114
    .. autofunction:: onevent
b6f00889355c [doc] Start documenting the API
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
   115
    .. autofunction:: validation_error