I'm learning how to use Bulbs models, I have questions on Node classes initialization.
From the documentation:
from bulbs.model import Node, Relationship
from bulbs.property import String, Integer, DateTime
from bulbs.utils import current_datetime
class Person(Node):
element_type = "person"
name = String(nullable=False)
age = Integer()
How can I perform data manipulation before saving the data in the node?
Can I perform something like
class Person(Node):
element_type = "person"
name = String(nullable=False)
if name == "Bar":
name = "Foo"
Or I have to override the Node init?
class Person(Node):
element_type = "person"
name = String(nullable=False)
def __init__(self, name):
if name == "Bar":
self.name = "Foo"