Did I find the right examples for you? yes no

All Samples(11)  |  Call(8)  |  Derive(0)  |  Import(3)

src/d/j/django-fixtureless-HEAD/fixtureless/factory.py   django-fixtureless(Download)
 
from fixtureless import exceptions
from fixtureless.generator import create_instance
from fixtureless.utils import list_get
 
    def _build_instance(self, model, kwargs, objs, create):
        if kwargs is not None:
            obj = create_instance(model, **kwargs)
        else:
            obj = create_instance(model)

src/d/j/django-fixtureless-1.2.0/fixtureless/factory.py   django-fixtureless(Download)
 
from fixtureless import exceptions
from fixtureless.generator import create_instance
from fixtureless.utils import list_get
 
    def _build_instance(self, model, kwargs, objs, create):
        if kwargs is not None:
            obj = create_instance(model, **kwargs)
        else:
            obj = create_instance(model)

src/d/j/django-fixtureless-HEAD/fixtureless/tests/test_django_project/test_django_project/test_app/tests/generator.py   django-fixtureless(Download)
 
from test_app.models import ModelOne, ModelTwo
from fixtureless.generator import create_instance
from fixtureless.constants import POSTGRES_SMALLINT_MAX, POSTGRES_INT_MAX, PY3
 
 
class ModelOneTest(TestCase):
    def setUp(self):
        self.model_one = create_instance(ModelOne)
    def setUp(self):
        self.model_one = create_instance(ModelOne)
        self.model_two_rand = create_instance(ModelTwo)
        self.model_two_kwarg = create_instance(
            ModelTwo, foreign_key=self.model_one)