fixture

class camelot.model.fixture.Fixture(**kwargs)[source]

Keep track of static data loaded into the database

classmethod findFixture(entity, fixture_key, fixture_class=None)[source]

Find a registered fixture, return None if no fixture is found

classmethod findFixtureKey(entity, primary_key)[source]

Find the fixture key for an object of type entity with primary key :return: fixture_key

classmethod findFixtureKeyAndClass(obj)[source]

Find the fixture key and class of an object @param obj: the object we are looking for @return: (fixture_key, fixture_class) if the object is a registered fixture, (None, None) otherwise

classmethod findFixtureKeysAndClasses(entity)[source]

Load all fixture keys of a certain entity in batch :param entity: the model class for which the fixtures should be found :return: a dictionary mapping the primary key of a on object of type entity to its (fixture key, fixture class)

classmethod removeFixture(entity, fixture_key, fixture_class)[source]

Remove a fixture from the database

class camelot.model.fixture.FixtureVersion(**kwargs)[source]

Keep track of the version the fixtures have in the current database, the subversion revision number is a good candidate to be used as a fixture version.

Returns:an integer representing the current version, 0 if no version found
classmethod get_current_version(fixture_class=None)[source]

Get the current version of the fixtures in the database for a certain fixture class.

Parameters:fixture_class – the fixture class for which to get the version
classmethod set_current_version(fixture_class=None, fixture_version=0)[source]

Set the current version of the fixtures in the database for a certain fixture class.

Parameters:
  • fixture_class – the fixture class for which to get the version
  • fixture_version – the version number to which to set the fixture version

Previous topic

batch_job

Next topic

i18n

This Page


Comments
blog comments powered by Disqus