File: data.py

package info (click to toggle)
python-restless 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 608 kB
  • sloc: python: 2,124; makefile: 148
file content (18 lines) | stat: -rw-r--r-- 754 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Data(object):
    def __init__(self, value, should_prepare=True, prepare_with=None):
        """
        A container object that carries meta information about the data.

        ``value`` should be the data to be returned to the client. This may
        be post-processed.

        ``should_prepare`` determines whether additional post-processing
        should occur & should be boolean. This is useful when returning objects
        or with complex requirements. Default is ``True``.

        ``prepare_with`` is reserved for future use in specifying a custom
        callable. Default is ``None`` (no custom callable).
        """
        self.value = value
        self.should_prepare = should_prepare
        self.prepare_with = prepare_with