@classmethod<EOL><INDENT>def fix_engine_table(cls):<DEDENT>
<EOL>if cls.engine.table_name:<EOL><INDENT>return<EOL><DEDENT>storage_models = [b for b in cls.__bases__ if issubclass(b, Model)<EOL>and not issubclass(b, DistributedModel)]<EOL>if not storage_models:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if len(storage_models) > <NUM_LIT:1>:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>cls.engine.table = storage_models[<NUM_LIT:0>]<EOL>
Remember: Distributed table does not store any data, just provides distributed access to it.

So if we define a model with engine that has no defined table for data storage
(see FooDistributed below), that table cannot be successfully created.
This routine can automatically fix engine's storage table by finding the first
non-distributed model among your model's superclasses.

>>> class Foo(Model):
...     id = UInt8Field(1)
...
>>> class FooDistributed(Foo, DistributedModel):
...     engine = Distributed('my_cluster')
...
>>> FooDistributed.engine.table
None
>>> FooDistributed.fix_engine()
>>> FooDistributed.engine.table
<class '__main__.Foo'>

However if you prefer more explicit way of doing things,
you can always mention the Foo model twice without bothering with any fixes:

>>> class FooDistributedVerbose(Foo, DistributedModel):
...     engine = Distributed('my_cluster', Foo)
>>> FooDistributedVerbose.engine.table
<class '__main__.Foo'>

See tests.test_engines:DistributedTestCase for more examples