File: document.py

package info (click to toggle)
python-redisearch-py 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,356 kB
  • sloc: python: 1,689; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import six

class Document(object):
    """
    Represents a single document in a result set 
    """

    def __init__(self, id, payload = None, **fields):

        self.id = id
        self.payload = payload
        for k, v in six.iteritems(fields):
            setattr(self, k, v)

    def __repr__(self):

        return 'Document %s' % self.__dict__