Objects

Types used in queries and responses. See the docs.

class faunadb.objects.FaunaTime(value)

FaunaDB time. See the docs.

For dates, regular datetime.date objects are used.

__init__(value)
Parameters:value – If a datetime.datetime is passed, it is converted to a string. Must include an offset.
to_datetime()

Convert to an offset-aware datetime object. This is lossy as datetimes have microsecond rather than nanosecond precision.

class faunadb.objects.Query(value)

Represents a @query type in FaunaDB. See the docs.

class faunadb.objects.Ref(id, cls=None, db=None)

FaunaDB ref. See the docs.

A simple wrapper around a string which can be extracted using ref.value. Queries that require a Ref will not work if you just pass in a string.

__init__(id, cls=None, db=None)

x.__init__(…) initializes x; see help(type(x)) for signature

class_(**kvargs)

Gets the class part out of the Ref.

collection()

Gets the collection part out of the Ref.

database()

Gets the database part out of the Ref.

id()

Gets the id part out of the Ref.

class faunadb.objects.SetRef(set_ref)

FaunaDB Set. This represents a set returned as part of a response. For query sets see Query.

__init__(set_ref)

x.__init__(…) initializes x; see help(type(x)) for signature