class Host(Node): element_plural = 'hosts' hostname = String(nullable=False, indexed=True, unique=True) branch = String() os = String() discovered = DateTime() ip_address = EmbeddedList(String()) listen_ports = EmbeddedList(String()) unreachable = Boolean() def to_dict(self): props = { key: value if type(value) != datetime.datetime else int( time.mktime(value.utctimetuple()) * 1000) for key, value in self._props.iteritems() } props.update({"id": self._id}) return props
class DateTimeV(DateTimeNode): element_type = 'datetime' element_plural = 'datetime' name = String(nullable=False, unique=True) at = DateTime(nullable=False)
class TransactionsRel(Relationship): element_plural = 'tx' element_type = 'tx' since = DateTime() tx = Float()