📓
Invana Docs
  • Invana
  • Getting Started
  • Products
    • Introduction
    • Python API
      • Modelling using OGM
      • Data Types
      • Indexes
      • Search
      • Schema Management
      • Event Triggers
    • Invana Engine
      • Installation
    • Invana Studio
  • Resources
    • Guides
    • Support
    • Blog
    • Opensource @ Invana
    • invana.io 🚀
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Products
  2. Python API

Modelling using OGM

Create Vertex Model

from invana.ogm import models, fields


graph = InvanaGraph("ws://megamind-ws:8182/gremlin", traversal_source="g")


class Project(models.VertexModel):
    graph = graph
    properties = {
        'name': fields.StringProperty(max_length=10, trim_whitespaces=True),
        'description': fields.StringProperty(allow_null=True, min_length=10),
        'rating': fields.FloatProperty(allow_null=True),
        'is_active': fields.BooleanProperty(default=True),
        'created_at': fields.DateTimeProperty(default=lambda: datetime.now())
    }
 
PreviousPython APINextData Types

Last updated 3 years ago

Was this helpful?