tickets: 6276
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6276 | 2007-12-26 11:57:31 | 2013-02-12 20:50:10 | 2022-03-06 03:36:42.126397 | Accepted | closed | Core (Other) | Bug | Normal | dev | fixed | Serializers should dump correct data for BooleanFields | I recently transferred my app from Mysql to Postgres and found out that dumping the db using dumpdata on the Mysql-database returned in values like "is_superuser" : 1 for json. This is fine from a Mysql point of view, but bad for Postgres. Why? Well the Postgres backend uses a Boolen Field Type for Django's BooleanField whereas Mysql uses a TinyInt(?) with length 1. So I wasn't able to load the data in Postgres as it complained about wrong types (expecting boolean, got integer, or something like this...). It worked fine after converting 1 to "True" and 0 to "False"- | nobody | anonymous | serializer booleanfield | 0 | 0 | 0 | 0 | 0 | 0 |