Re: [python-uk] Tumbleweed badge

2017-10-30 Thread Hansel Dunlop
Hi James, yup, that's right. And I certainly have done that automatic transform for the WHERE part of the query. However it's the SELECT part that doesn't have any hooks. But Kuba's suggestion of writing a custom backend will. Though because it's just an optimisation I think I can leave it for now.

Re: [python-uk] Tumbleweed badge

2017-10-27 Thread James Cheese
Hi Hansel, Might be missing the point, but... If you're looking to reference the individual fields, can you leverage the Postgres JsonField's key lookup functionality? As per https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/fields/#key-index-and-path-lookups A quick bit of code inspect

Re: [python-uk] Tumbleweed badge

2017-10-26 Thread Hansel Dunlop
Thank you Kuba! That's interesting. Good to know it's possible . If not, perhaps, advisable. I imagine my translated fields could register the models they're on and "as_sql" could do a quick lookup to see if we were referencing any of them in the particular query. I have looked at existing alterna

Re: [python-uk] Tumbleweed badge

2017-10-26 Thread Kuba
Hi Hansel, On 26 October 2017 at 18:52, Hansel Dunlop wrote: > Hi all, > > So I just got a notification from Stackoverflow that this question - > https://stackoverflow.com/questions/46804936/custom- > django-field-type-with-modified-column-look-up-in-select-part - was just > awarded the tumblew

[python-uk] Tumbleweed badge

2017-10-26 Thread Hansel Dunlop
Hi all, So I just got a notification from Stackoverflow that this question - https://stackoverflow.com/questions/46804936/custom-django-field-type-with-modified-column-look-up-in-select-part - was just awarded the tumbleweed badge (no, votes, no answers, and no views)... So throwing this open to