I have this Postgresql query:
select a.code from accounts a where a.code like '0077-7575%' or '0077-7575' like a.code||'%'
At django I am trying to do this:
q = Accounts.objects.filter(Q(code__startswith='0077-7575') | Q('0077-7575'__startswith=code))
The thing is I don't know and can't find a way to translate '0077-7575' like a.code||'%'
into django since a.code is the field name... How can I solve this?