#29168: Custom lookup documentation is incomplete
-------------------------------------+-------------------------------------
Reporter: jjwatt99 | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.0
layer (models, ORM) |
Severity: Normal | Keywords: lookup
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The page for creating custom field lookups is incomplete. I am referring
to the doc at https://docs.djangoproject.com/en/2.0/howto/custom-lookups/.
The documentation is unclear about how to use the left-hand side value
(lhs) and right-hand side value (rhs) properly. For example, lets say you
have a lookup like
{{{
id__custom='abc123'
}}}
The lhs is the ID field and the rhs is the 'abc123'. I want to create a
query like
{{{
WHERE 'abc123' LIKE id||%
}}}
However the documentation is unclear about how to reference the lhs in the
as_sql method. Users would like to know how to reference the rhs BEFORE
the LIKE and the lhs AFTER the LIKE in the sql query above. The
documentation only shows examples where the lhs comes first and the rhs
last. This would help users create a custom lookup with the sql above.
--
Ticket URL: <https://code.djangoproject.com/ticket/29168>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.225c8d3dd44fa245200495d326f837b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.