theonion / django-bulbs

DEPRECATED: This project is now part of the Mono Repo (https://github.com/theonion/omni)
MIT License
26 stars 7 forks source link

Fix special coverage migration save #119

Closed mparent61 closed 8 years ago

mparent61 commented 8 years ago

v0.7.3 Fix special coverage migration to grab model directly so that custom SpecialCoverage.save() method is called and triggers _save_percolator.

A model obtained from apps.get_model() calls the generic save(), and does not call a custom save() method like SpecialCoverage.save(). This surprised me, take heed when using app.get_models() in your migration scripts.

https://realpython.com/blog/python/data-migrations/#comment-1843026722

mparent61 commented 8 years ago

@benghaziboy @MichaelButkovic

MichaelButkovic commented 8 years ago

huh, very weird

MichaelButkovic commented 8 years ago

LGTM

camsom commented 8 years ago

provided this has run,

LGTM

mparent61 commented 8 years ago

Yeah runs locally. I think the dependency issues involve cross-app dependencies. Also by not using get_model() you can run into trouble if your migration also modifies schema.