Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
Caution
You're viewing documentation for a previous version of Scylla Python Driver. Switch to the latest stable version.
Model classes for User Defined Types
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 cassandra.cqlengine.columns import Text, Integer
from cassandra.cqlengine.usertype import UserType
class address(UserType):
street = Text()
zipcode = Integer()
from cassandra.cqlengine import management
management.sync_type(address)
Please see User Defined Types for a complete example and discussion.
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.
Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.