Opened 4 years ago

Closed 14 months ago

#18207 closed Bug (duplicate)

concrete inheritence, mysql defer bug

Reported by: leftmoose Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Using concrete inheritence, mysql and defer, values returned aren't properly converted to objects

regressiontests/model_inheritance_regress/tests.py
adding

    def test_concrete_ineritance_defer(self):
        Restaurant.objects.create(
            name="Guido's House of Pasta",
            address='944 W. Fullerton',
            serves_hot_dogs=True,
            serves_pizza=False)
        value_with_defer = Restaurant.objects.defer('name').get().serves_pizza
        self.assertIs(value_with_defer, False)

fails when using a mysql database

value_with_defer comes back as 0, not False

Change History (3)

comment:1 Changed 4 years ago by Anssi Kääriäinen

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Confirmed for Oracle, too.

comment:2 Changed 4 years ago by Anssi Kääriäinen

Type: UncategorizedBug

comment:3 Changed 14 months ago by Tim Graham

Resolution: duplicate
Status: newclosed

Fixed by #21203

Note: See TracTickets for help on using tickets.
Back to Top