Comments (11)
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.
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.
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.
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.
From [email protected] on March 28, 2011 13:52:17
What is the status of this bug for today?
from django-modeltranslation.
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.
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.
From eschler on April 10, 2011 20:27:27
This issue was closed by revision r103.
from django-modeltranslation.
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.
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.
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)
- error in tabbed_translation_fields HOT 3
- How to properly dynamically add ModelForm fields? HOT 7
- Add a feature to translate the model.fields default value based on field language. HOT 5
- Translated JSONField now always returns str HOT 5
- Support for Subquery HOT 5
- Crash when a model with multi-table inheritance also has default ordering HOT 1
- Columns for all languages are added to table HOT 3
- please remove last reference to six on poetry.lock HOT 4
- MODELTRANSLATION_AUTO_POPULATE problem HOT 1
- Question ? : Original field does not contains the default language HOT 4
- Question about Indonesian language code HOT 1
- Fire event when JS is initiated HOT 1
- Typing support HOT 1
- sync_translation_fields vs makemigrations HOT 1
- Django 5 support? HOT 6
- AttributeError: 'str' object has no attribute 'mro'
- no fields appear for translation in admin panel HOT 2
- Iterable classes have incorrect inheritence HOT 1
- Translated foreign key in an abstract base class: foreign key instances cannot be deleted. HOT 5
- Support for Subquery and other expressions in annotate() HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-modeltranslation.