dse.cqlengine.usertype - Model classes for User Defined Types


class UserType

This class is used to model User Defined Types. To define a type, declare a class inheriting from this, and assign field types as class attributes:

# connect with default keyspace ...

from dse.cqlengine.columns import Text, Integer
from dse.cqlengine.usertype import UserType

class address(UserType):
    street = Text()
    zipcode = Integer()

from dse.cqlengine import management

Please see User Defined Types for a complete example and discussion.


= None

Optional. Sets the name of the CQL type for this type.

If not specified, the type name will be the name of the class, with it’s module name as it’s prefix.