【问题标题】:Can I specify the labels in subclasses when using GQLAlchemy and Memgraph?使用 GQLAlchemy 和 Memgraph 时可以在子类中指定标签吗?
【发布时间】:2022-11-14 15:14:45
【问题描述】:

我的问题是大量继承的标签。有时有很多超类,我不想继承所有标签。在 GQLAlchemy 中使用 Python OGM 时,是否可以在子类中手动指定标签?

【问题讨论】:

    标签: memgraphdb


    【解决方案1】:

    您可以在创建类时指定标签,如下所示:

    class Streamer(User, labels=["Twitcher", "Streamer"]):
    

    存在关键字labels,它应该覆盖类名。

    【讨论】:

      猜你喜欢
      • 2019-11-04
      • 2014-05-31
      • 1970-01-01
      • 1970-01-01
      • 2022-11-14
      • 2016-07-26
      • 1970-01-01
      • 1970-01-01
      • 2022-12-05
      相关资源
      最近更新 更多