Factory for Mogwai models.

exception, exception)

Provides information about a failed import_string() attempt.

exception = None
import_name = None

Lazily load and return a class


Imports the class and caches

class, name=None, doc=None)

A decorator that converts a function into a lazy property. The function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value:

class Foo(object):

    def foo(self):
        # calculate something important here
        return 42

The class has to have a __dict__ in order for this property to work., silent=False)

Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (xml.sax.saxutils.escape) or with a colon as object delimiter (xml.sax.saxutils:escape).

If silent is True the return value will be None if the import fails.

  • import_name – the dotted name for the object to import.
  • silent – if set to True import errors are ignored and None is returned instead.

imported object


Find all Vertex and Edge types available in the database

mogwai.spec.write_compiled_indices_to_file(filename, spec=None)

Write the compile index specification to file

Parameters:filename (basestring) – The file to write to
mogwai.spec.write_diff_indices_to_file(filename, spec=None)

Preview of index diff specification to write to file

Parameters:filename (basestring) – The file to write to

Generate and write a specification to file

Parameters:filename (basestring) – The file to write to