@step(STEP_PREFIX + r'<STR_LIT>'<EOL>+ r'<STR_LIT>')<EOL>def _create_models_for_relation_step(self, rel_model_name,<EOL>rel_key, rel_value, model):
model = get_model(model)<EOL>lookup = {rel_key: rel_value}<EOL>rel_model = get_model(rel_model_name).objects.get(**lookup)<EOL>data = guess_types(self.hashes)<EOL>for hash_ in data:<EOL><INDENT>hash_['<STR_LIT:%s>' % rel_model_name] = rel_model<EOL><DEDENT>try:<EOL><INDENT>func = _WRITE_MODEL[model]<EOL><DEDENT>except KeyError:<EOL><INDENT>func = partial(write_models, model)<EOL><DEDENT>func(data, None)<EOL>
Create a new model linked to the given model.

Syntax:

    And `model` with `field` "`value`" has `new model` in the database:

Example:

.. code-block:: gherkin

    And project with name "Ball Project" has goals in the database:
        | description                             |
        | To have fun playing with balls of twine |