Data Types

StringProperty

1
// Some code
2
​
3
class Project(VertexModel):
4
graph = graph
5
properties = {
6
'name': StringProperty(min_length=1, max_length=10, trim_whitespaces=True)
7
}
Copied!

IntegerProperty

1
// Some code
2
from invana.ogm import fields
3
class Project(VertexModel):
4
graph = graph
5
properties = {
6
'age': fields.IntegerProperty(min_value=1, max_value=100)
7
}
Copied!

FloatProperty

1
// Some code
2
from invana.ogm import fields
3
class Project(VertexModel):
4
graph = graph
5
properties = {
6
'rating': fields.FloatProperty(min_value=1, max_value=100)
7
}
Copied!

BooleanProperty

1
// Some code
2
from invana.ogm import fields
3
class Project(VertexModel):
4
graph = graph
5
properties = {
6
'is_active': fields.BooleanProperty(default=True)
7
}
Copied!

DateTimeProperty

1
// Some code
2
from invana.ogm import fields
3
class Project(VertexModel):
4
graph = graph
5
properties = {
6
'created_at': fields.DateTimeProperty(default=lambda: datetime.now())
7
}
Copied!