deschler / django-modeltranslation

Translates Django models using a registration approach.
BSD 3-Clause "New" or "Revised" License
1.38k stars 258 forks source link

Need to remove unwanted translation fields when language setting changes #257

Open pwhipp opened 10 years ago

pwhipp commented 10 years ago

I had this problem so hacked this quick solution which you might want to make use of (probably by integrating into your sync command).

zlorf commented 10 years ago

Thanks for info. You didn't use any migrations system, did you?

pwhipp commented 10 years ago

No. The project is in early development, I generally only turn South on after the bulk of development work is complete - it is quicker and easier to recreate the database as the models change during early development.

zlorf commented 10 years ago

I see. Good news - new built-in migration system for Django 1.7 can handle this gracefully as it expose management command to squash a few migration files into one: https://docs.djangoproject.com/en/dev/topics/migrations/#squashing-migrations

pwhipp commented 10 years ago

Looks very cool... although I worry that elements of Django are trying to get too clever - trouble is that such things might only work 90% of the time and the other 10% could take ten times the effort it would previously have taken to sort it out - I hope I'm wrong in this case ;)