Skip to content

Instantly share code, notes, and snippets.

@loic
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loic/c2dff2cac6acb05b7ba8 to your computer and use it in GitHub Desktop.
Save loic/c2dff2cac6acb05b7ba8 to your computer and use it in GitHub Desktop.
loic84: ping jarshwah_
11:09 jarshwah_: pong loic84
11:10 jarshwah_: I'm around for about 20 minutes then away for an hour or two
11:12 patrys has left IRC (Ping timeout: 246 seconds)
11:13 loic84: jarshwah_: cool that's plenty enough ;)
11:14 loic84: jarshwah_: what's the current status of expression for filter/exclude?
11:15 jarshwah_: as in the combining of Expressions and Lookups?
11:16 jarshwah_: I haven't done anything with it since my POC patch
11:16 jarshwah_: I've had ideas, but haven't got the chance to sit down and do it
11:16 loic84: is there a ticket?
11:16 jarshwah_: https://github.com/django/django/pull/4482
11:16 jarshwah_: https://code.djangoproject.com/ticket/24629
11:17 loic84: cool, some background: https://gist.github.com/loic/6f451a411f7186994709
11:17 jarshwah_: what is .key() ?
11:17 loic84: a lookup for JSONField
11:18 jarshwah_: yup I suspected
11:18 jarshwah_: I don't mind the syntax, but it's departing_from_how_django_normally__works :P
11:19 Jack86596 has left IRC (Quit: My Mac has gone to sleep. ZZZzzz…)
11:19 loic84: hehe yes, but it supports things we__cant__currently__support :P
11:19 zanzan has left IRC (Ping timeout: 258 seconds)
11:19 jarshwah_: yeah I've been thinking about how we might support more expressive syntaxes
11:19 zanzan has joined (~zanzan@janet-dip-pool157.dip.cf.ac.uk)
11:20 loic84: like .substr(10, 20), or .key(42) or key('é')
11:20 jarshwah_: F('data').key() would be difficult to make work though
11:20 loic84: you mean the sugar?
11:20 jarshwah_: F() doesn't have a type until it's executed
11:20 jarshwah_: yeah the sugar
11:21 loic84: yeah, I have a bare bone implementation already for this
11:21 loic84: similar to select_related
11:21 loic84: we just collect info, then validate when the query is executed
11:22 garrypolley has joined (~garryp@2605:a601:4d1:df00:1427:9647:58f7:463b)
11:22 loic84: I updated the gist with some pseudocode for the sugar
11:25 jarshwah_: yeah I figured it must be some getattr magic
11:26 garrypolley has left IRC (Ping timeout: 256 seconds)
11:26 jarshwah_: basically, we need to make Lookups and Transforms some kind of Expression subclass
11:26 areski has joined (~areski@32.Red-83-47-150.dynamicIP.rima-tde.net)
11:27 jarshwah_: and add a register_transform alongside register_lookup
11:27 jarshwah_: still not sure how to proceed wrt the whole self.lhs and self.rhs and maintain backwards compat
11:27 jarshwah_: also the process_{l,r}hs methods
11:28 jarshwah_: perhaps they could be called from resolve_expression
11:28 jarshwah_: and self.lhs can be a property that backs onto get/set_source_expressions
11:29 tomchristie has joined (~textual@185.65.109.141)
11:29 jarshwah_: I've not had a lot of spare time lately for hacking away unfortunately, but I'm hopeful to get it done for 1.9 if no one else beats me to it
11:29 loic84: we gonna sprint on it, but no guarantee obviously ;)
11:29 jarshwah_: excellent, absolve me! haha
11:30 denys has left IRC (Quit: Konversation terminated!)
11:30 jarshwah_: well ^ those are my notes pretty much
11:30 jarshwah_: the POC with Func.transformer was hacky, and I wouldn't progress that way further I think
11:31 jarshwah_: gotta run, good luck.. and I'm usually floating around so ping me if needed and I'll respond when I can
11:31 jarshwah_: when are the sprints?
11:32 loic84: now ;)
11:39 ticketbot has left IRC (Remote host closed the connection)
11:39 ticketbot has joined (~ticketbot@ec2-54-145-36-2.compute-1.amazonaws.com)
11:43 loic84: mjtamlyn: got a PR for as_transform?
11:43 mjtamlyn: commenting on jarshwah_'s commit now
11:45 loic84: cool, if you've got a linkable diff for your branch share it, I'm collecting all the bits and pieces we have.
11:46 mjtamlyn: loic84: https://github.com/django/django/pull/4748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment