On 12 Jun 11:06, Cédric Krier wrote:
> Hi,
> 
> We get some astonishement with the current behavior of the client with
> the range search syntax.
> 
> Currently: `Field: 1..42` will become
> 
>     `[('field', '>=', 1), ('field', '<', 42)]`
> 
> But it seems people expect:
> 
>     `[('field', '>=', 1), ('field', '<=', 42)]`
> 
> One point about the current behavior is that you can slide the range by
> the length and it will not contain any duplication.
> 
> So what do you think?

I discussed quite a lot with Nicolas today about this topic and here are
what we found:

- the open segment is often used to express a condition (not an
  enumeration) or a constraint.

- the close segment is often used when we can enumerate the
  possibilities. For example, with dates as it is a discret segment we
  expect sides to be included. But with date times as it is a continue
  segement we don't expect the upper side to be included.
  But there is an exception when the number of element is very large
  then it seems our mind consider it as an continuum.

- the current implementation was probably inspired by the Python range
  which provides good behavior when programming like concatenation
  without duplication, end - start == length etc.

- An analysis of Tryton usage of date range:

    - fiscal year: close
    - period: close
    - move: close
    - tax: close
    - asset: close
    - analytic: close
    - opportunity: close
    - timesheet: close

- The «..» probably reflect better a enumeration than a infinite number
  of element.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpowT8YYsczZ.pgp
Description: PGP signature

Reply via email to