我在卡桑德拉集羣如何在cqlengine蟒蛇模型
CREATE TABLE users (
username text PRIMARY KEY,
creationdate bigint,
email text,
firstlogin boolean,
firstname text,
lastloggedin bigint,
lastname text,
lastprofileupdate bigint,
name text,
olduserid int,
profile frozen<profile_type>,
user_id uuid
和用戶定義類型,profile_type定義爲如下以下表模式代表卡桑德拉用戶定義類型...
CREATE TYPE profile_type (
birthdate timestamp,
gender text,
title text,
relationshipstatus text,
homecountry text,
currentcountry text,
timezone text,
profilepicture blob,
alternate_email text,
religion text,
interests list<text>,
cellphone text,
biography text
);
如何將此結構表示爲cqlengine模型?我對用戶定義的類型表示特別感興趣,因爲我沒有看到任何列定義來表示這種情況?那麼我需要手動映射嗎?到目前爲止,我有這個python ....
class User(Model):
username = columns.Text(primary_key=True)
firstname = columns.Text(required=True)
lastname = columns.Text(required=True)
email = columns.Text(required=True)
name = columns.Text(required=False)
olduserid = columns.Integer()
user_id = columns.UUID(default=uuid.uuid4)
creationdate = columns.BigInt()