﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21865	Greater than/Less than symbols incorrect in 1.7 alpha-1 documentation for Custom Lookups	john.young.dev@…	nobody	"The documentation for 1.7-alpha-1 gives an example for writing a custom lookup to generate the following SQL: 


{{{#!sql
SELECT .. WHERE ""experiments"".""change"" < 27 AND ""experiments"".""change"" > -27
}}}


{{{#!python
from django.db.models import Lookup

class AbsoluteValueLessThan(Lookup):
    lookup_name = 'lt'

    def as_sql(self, qn, connection):
        lhs, lhs_params = qn.compile(self.lhs.lhs)
        rhs, rhs_params = self.process_rhs(qn, connection)
        params = lhs_params + rhs_params + lhs_params + rhs_params
        return '%s > %s AND %s < -%s' % (lhs, rhs, lhs, rhs), params

AbsoluteValue.register_lookup(AbsoluteValueLessThan)
}}}

The return statement has the < and > symbols incorrectly reversed to create 
{{{#!sql
""experiments"".""change"" > 27 AND ""experiments"".""change"" < -27
}}}
."	Uncategorized	closed	Documentation	1.7-alpha-1	Normal	fixed			Accepted	0	0	0	0	1	0
