On 14 Apr 17:53, Iasmini - Gmail wrote:
> Hi,
> 
> How do I filter between 2 dates in a wizard?
> 
> For greater then this works fine:
> 
>         if self.start.opening_date_start:
>             parameters.append(('create_date', '>=',
> DateTime(self.start.opening_date_start.year,
>                 self.start.opening_date_start.month,
>                 self.start.opening_date_start.day,
>                 hour=0, minute=0, second=0, microsecond=0))),
> 
> I tried this, but it says too many values to unpacking:
> 
>         if self.start.opening_date_start:
>             parameters.append(('create_date', '>=',
> DateTime(self.start.opening_date_start.year,
>                 self.start.opening_date_start.month,
>                 self.start.opening_date_start.day,
>                 hour=0, minute=0, second=0, microsecond=0),
>                                             'create_date', '<=',
> DateTime(self.start.opening_date_end.year,
>                 self.start.opening_date_end.month,
>                 self.start.opening_date_end.day,
>                 hour=0, minute=0, second=0, microsecond=0))),

Must use an AND:

    ['AND', ('create_date', '>=', …), ('create_date', '<=', …)]

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgp8N7brgIEZs.pgp
Description: PGP signature

Reply via email to