New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a clear statement regarding South #106
Comments
Forgot to mention that South itself happens to use modeltranslation as an example in its documentation about custom fields. So my impression is that the only problem other apps have with modeltranslation is the fact, that existing projects have to run |
I think the other problem is that south does not expect schemamigrations to be happening from anywhere but the app. So let's say you translate the app foo, then create a schemamigration for it. It will be called something like 0002_translate_foo (it comes after 0001_initial). Then you update the app foo, and it comes with it's own migration to add new fields, this migration is called 0002_add_fields. South will now get confused, the new migration won't list the translated fields, but a previous migration (the one created for modeltranslations) did. I'm not sure if I'm explaining it well. But the general point is that modeltranslations creates migrations that are not really application migration and things will get confusing after a while, especially when a application starts shipping new migrations. Things get more confusing if you start adding new translation migrations to translate these new fields in the application. It would be helpful for you to talk to @andrewgodwin, as he's the autor of South and is also working on getting schemamigrations in django.contrib. Or talk to the people in #django-south on freenode. |
I agree that it has to be clarified. I don't know what is the right way because there are certainly several use cases and I don't have a deep knowledge on both apps. |
I've made some research and wrote down my final thoughs in the docs. Summary here:
The only thing I'm not quite sure about are "migration freezes" (the dump of model fields included in every migration file). They will always lack the translation files, but it seems it doesn't matter and app migrate successfully anyway, without any warning. |
I may be wrong but I am wondering if the right way to manage it would be:
Currently I have a workaround for this : I don't add model translation to the INSTALLED_APPS if schematranslation is in sys.argv. It seems ok. What do you think about this approach? |
As long as you handle migrations for your own app (non-reusable), you can freely and safely use south. |
Modeltranslation has to make a clear statement regarding South, which can be considered the de-facto standard for database migrations in the Django world nowadays.
While modeltranslation includes a little helper, namely the
south_field_triple
infields.TranslationField
, this obviously isn't enough to cover all use cases. It seems to satisfy the basic needs, but especially 3rd-party-apps have additional requirements (e.g. i've stumbled across a ticket in django-fiber, the comments are somewhat contrary, but there obviously is a problem).The included management commands
update_translation_fields
andsync_translation_fields
help with most modeltranslation related migrations, but reinvent solutions that might probably better be addressed through South.This ticket tries to gather the facts and evaluate what we can do (if at all) to improve the current situation, even if this only means to take a clear stand in the documentation.
That said, i am not a good candidate to make modeltranslation more South-friendly as my knowledge about it is basic at best.
Ideas and suggestions are highly appreciated.
The text was updated successfully, but these errors were encountered: