MasoniteFramework / orm

Masonite ORM is a beautiful Python ORM. It's also a nearly drop in replacement of the Orator ORM
https://orm.masoniteproject.com
MIT License
165 stars 48 forks source link

Cannot use multi where in first_where method #804

Open LordDeveloper opened 1 year ago

LordDeveloper commented 1 year ago

Hey, This is my code:

payment = Payment.first_where({
    'transaction_id': req.get('trans_id'),
    'order_id': req.get('order_id')
})

Error: masoniteorm.exceptions.QueryException: (1054, "Unknown column 'payments.{'transaction_id': 'ff9db407-b55c-494b-a8af-a1944cedab0a', 'id': '1'}' in 'where clause'")

Marlysson commented 1 year ago

Until solve this, could you try this:

Model.where(field1, value1).where(field2, value2).first()

?

LordDeveloper commented 1 year ago

Referenc

Hi, Yes this is working correctly.