Closed daisylb closed 4 years ago
Some to-do items courtesy of feedback from @rixx:
R(something=lambda _: timezone.now())
, but that's not pretty.[ ] Add support for lookups, like __lte
. Currently R
assumes that lookups aren't used. Ideally, it should detect which parts of a kwarg key would be interpreted by Django as lookups, and then if that lookup is supported, use a Python implementation of the lookup with the same semantics in .check()
, and throw an error otherwise.
Ideally, this error would be thrown when the R
object is created, because it's better to fail early, but I'd need to look at how lookups work in Django; I'm concerned that whether something is following a FK or a lookup might be selectively determined based on metadata about the model, which isn't available to us at the time R
's constructor is called. (For instance, does Django determine the meaning of foo__lte
by checking either to see if foo
is of a type that supports the __lte
lookup, and/or checking if it's a FK to a model with a lte
field?)
R
takes multiple kwargs.I also want to do a bunch more work on the guides in the docs, but that's mostly separate to this ticket.
I accidentally closed this while renaming the main branch :S
This is now merged 🎉
Fixes #9.
You can read documentation for this branch here: http://storage.googleapis.com/bridgekeeper-docs/refs/heads/r-objects/index.html