dominno / django-moderation

django-moderation is reusable application for Django framework, that allows to moderate any model objects.
BSD 3-Clause "New" or "Revised" License
268 stars 91 forks source link

BooleanField in moderated model #38

Closed ouhouhsami closed 10 years ago

ouhouhsami commented 13 years ago

Hello,

I have a BooleanField() in a moderated model using django-moderation. The problem is that, apparently inside class SerializedObjectField, 'True' is serialized as 1, and 'False' to 0, so that the app doesn't really work, always finding a difference between 'True' and 1, and 'False' and 0

edit: and I'm using mysql database.

Any workaround ?

treyhunner commented 13 years ago

I haven't noticed this problem before. I think boolean fields only show a difference for me on True and False, though I haven't tested this well.

You could use fields_exclude if changes to the field don't require moderation.

ouhouhsami commented 13 years ago

I need moderation for these boolean values too ... may be I shoud switch to postgre (, but it's not a really good answer ;) )

treyhunner commented 13 years ago

I can't reproduce the issue currently. What database are you using currently?

ouhouhsami commented 13 years ago

I was using mysql until now, but I just switched to postgresql. On mysql, one sure thing is that boolean serialized where 1 for True and 0 for False, so that, each time, there was a difference between the value, and the 'modified' one (event if it wasn't modified) : the obj_changed value L47 in the manager.py was always True.

(On postgresql, I haven't got more problem with BooleanField (which value stay False and True). But the obj_changed remains to True, think it's a problem with geodjango, I need to test deeply.)

dominno commented 13 years ago

Have you resolved this issue ?

ouhouhsami commented 13 years ago

not for mysql.