| Commit message (Expand) | Author | Age |
* | Clarify .build() issue with Django>1.8 (Ref #198).•••From 1.8 onwards, this crashes:
>>> a = MyModel() # Don't save
>>> b = MyOtherModel(fkey_to_mymodel=a)
In turn, it breaks:
class MyModelFactory(factory.django.DjangoModelFactory):
class Meta:
model = MyModel
class MyOtherModelFactory(factory.django.DjangoModelFactory):
class Meta:
model = MyOtherModel
fkey_to_mymodel = factory.SubFactory(MyModelFactory)
MyOtherModelFactory.build() # Breaks
The error message is: Cannot assign "MyModel()": "MyModel" instance isn't saved in the database.
See https://code.djangoproject.com/ticket/10811 for details.
| Raphaël Barrois | 2015-04-25 |
* | Add support for multidb with Django (Closes #171).•••The ``factory.django.DjangoModelFactory`` now takes an extra option:
```
class MyFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.MyModel
database = 'replica'
```
This will create all instances of ``models.Model`` in the ``'replica'``
database.
| Raphaël Barrois | 2015-03-26 |
* | Fix typos in docs (Closes #159, closes #178, closes #188). | Raphaël Barrois | 2015-03-03 |
* | docs: Improve explanation of SQLAlchemy's scoped_session. | Raphaël Barrois | 2015-02-06 |
* | docs: Add explanations about SQLAlchemy's scoped_session. | Raphaël Barrois | 2015-02-06 |
* | Remove deprecated features.•••This disables the ``FACTORY_FOR`` syntax and related parameters,
that should be declared through ``class Meta``.
| Raphaël Barrois | 2014-11-18 |
* | Remove automagic pk-based sequence setup•••Related to issues #78, #92, #103, #111, #153, #170
The default value of all sequences is now 0; the automagic
``_setup_next_sequence`` behavior of Django/SQLAlchemy has been removed.
This feature's only goal was to allow the following scenario:
1. Run a Python script that uses MyFactory.create() a couple of times
(with a unique field based on the sequence counter)
2. Run the same Python script a second time
Without the magical ``_setup_next_sequence``, the Sequence counter would be set
to 0 at the beginning of each script run, so both runs would generate objects
with the same values for the unique field ; thus conflicting and crashing.
The above behavior having only a very limited use and bringing various
issues (hitting the database on ``build()``, problems with non-integer
or composite primary key columns, ...), it has been removed.
It could still be emulated through custom ``_setup_next_sequence``
methods, or by calling ``MyFactory.reset_sequence()``.
| Raphaël Barrois | 2014-11-16 |
* | doc: Document upgrade path for FACTORY_*. | Raphaël Barrois | 2014-05-31 |
* | Introduce back missing doc about migrating FACTROY_DJANGO_GET_OR_CREATE. | Raphaël Barrois | 2014-05-21 |
* | Rename 'target' to 'model'. | Raphaël Barrois | 2014-05-18 |
* | Update docs for class Meta. | Raphaël Barrois | 2014-05-18 |
* | Add doc for factory.django.mute_signals. | Raphaël Barrois | 2014-01-21 |
* | Add doc for MongoEngineFactory's support of EmbeddedDocument.•••Closes #100, #112.
| Raphaël Barrois | 2013-12-25 |
* | doc: Fix typo in django notes. | Raphaël Barrois | 2013-10-05 |
* | Fix Django sequences with abstract base models. | Raphaël Barrois | 2013-09-25 |
* | Add 'factory.debug' context manager. | Raphaël Barrois | 2013-09-17 |
* | Adding factory support for mongoengine (Closes #89). | Jonathan Tushman | 2013-09-13 |
* | Allow FACTORY_FOR = 'app.Model' for Django (Closes #66). | Raphaël Barrois | 2013-08-28 |
* | Add factory.django.ImageField (Closes #52). | Raphaël Barrois | 2013-06-27 |
* | Updated documentation | rcommande | 2013-06-20 |
* | Move DjangoModelFactory / MogoFactory to their own modules. | Raphaël Barrois | 2013-06-09 |
* | Add support for get_or_create in DjangoModelFactory. | Raphaël Barrois | 2013-04-02 |
* | Add a 'after post_generation' hook to Factory.•••Use it in DjangoModelFactory to save objects again if a post_generation hook ran.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
| Raphaël Barrois | 2013-03-04 |
* | Rewrite the whole documentation.•••Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
| Raphaël Barrois | 2013-03-03 |