diff options
Diffstat (limited to 'factory/mongoengine.py')
-rw-r--r-- | factory/mongoengine.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/factory/mongoengine.py b/factory/mongoengine.py index 462f5f2..f50b727 100644 --- a/factory/mongoengine.py +++ b/factory/mongoengine.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2010 Mark Sandstrom -# Copyright (c) 2011-2013 Raphaël Barrois +# Copyright (c) 2011-2015 Raphaël Barrois # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,15 +32,17 @@ from . import base class MongoEngineFactory(base.Factory): """Factory for mongoengine objects.""" - ABSTRACT_FACTORY = True + + class Meta: + abstract = True @classmethod - def _build(cls, target_class, *args, **kwargs): - return target_class(*args, **kwargs) + def _build(cls, model_class, *args, **kwargs): + return model_class(*args, **kwargs) @classmethod - def _create(cls, target_class, *args, **kwargs): - instance = target_class(*args, **kwargs) + def _create(cls, model_class, *args, **kwargs): + instance = model_class(*args, **kwargs) if instance._is_document: instance.save() return instance |