| ▲ | charettes 2 hours ago | |
There are valid reasons for not using an ORM but the points made in this article are plain false. >“Roughly” because Django ORM doesn’t support the JSONB `?` operator. The `has_key` [lookup](https://docs.djangoproject.com/en/6.0/topics/db/queries/#has...) does exactly that. > And if you need real SQL intervals, Django pushes you towards raw expressions or `Func()` wrappers. It's possible to use a very similar construct to SQL Alchemy here by using the `Now` [function](https://docs.djangoproject.com/en/6.0/ref/models/database-fu...) (it uses `STATEMENT_TIMESTAMP` which is likely more correct than `NOW()` here alternatively there is `TransactionNow`) by doing `Now() - timedelta(days=30)`. The result is the following `filter` call
which translates to the following SQL
which can be confirmed in [this playground](https://dryorm.xterm.info/hn-47110310) | ||