Git Product home page Git Product logo

Comments (11)

deschler avatar deschler commented on June 3, 2024

From eschler on September 10, 2010 09:28:25
Can't reproduce the issue. What database backend do you use? The original field is cleared correctly here with MySQL.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on September 10, 2010 11:41:21
I use MySQL
django 1.2.1

It is strange. If I change default tranlastion to something, original field update correctly. But if I clear textfield input, than "title_ru" field becomes Null, but "title" field stay old...

Here is project example I used to reproduce the issue.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From eschler on September 10, 2010 12:45:43
Thanks for the example project, i'll give it a try.

Is this an admin only problem or does it exist outside the admin, too? You can try it from a project shell (./manage.py shell) like this:

obj = MyModel.objects.get(id=1)
print obj.foo
bar
obj.foo = ''
obj.save()

This assumes obj.foo is already set to "bar" and then cleared. After save, you can check the db value of the original field. If it's still set to "bar", something is wrong at a lower level of modeltranslation than the admin integration.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on September 11, 2010 12:29:41
I tried it outside admin as you wrote. It seems everything is ok - original field update to empty correctly. Problem appears in admin only.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on March 28, 2011 13:52:17
What is the status of this bug for today?

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on April 08, 2011 09:53:32
I can confirm that this bug is still present with Django 1.3. It is an admin-only (but indeed very annoying) problem. Any chance for a fix in the near future? ;-)

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From eschler on April 10, 2011 16:35:38
I've managed to reproduce the bug using the example project. Something seems to go wrong in TranslationField.pre_save. The original field is updated correctly if the value of the translated field is not empty, but it fails if the value is an empty string.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From eschler on April 10, 2011 20:27:27
This issue was closed by revision r103.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From eschler on April 10, 2011 20:33:37
This was really a nasty one. I hope r103 resolves the issue. Please note that null constraints are currently not handled, if the default translation field is cleared and saved, the original field is set to an empty string.

Please let me know if it works for you.

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on April 11, 2011 12:35:23
I did some quick tests and it seems to work as expected. Thanks for the fix!

from django-modeltranslation.

deschler avatar deschler commented on June 3, 2024

From [email protected] on January 14, 2012 11:11:09
Having this bug.

Field can be changed, but cannot be set to empty string from admin. Both translated and original fields are not updated in the database. This happens only to default language fields.

Django 1.3.1, mysql, django_modeltranslation-0.3.2

from django-modeltranslation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.