Changes between Initial Version and Version 1 of Ticket #33590


Ignore:
Timestamp:
Mar 20, 2022, 5:49:45 PM (3 years ago)
Author:
Stefan de Konink
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33590 – Description

    initial v1  
    626221-03-2022 01:00:00 - 21-03-2022 02:00:00
    6363
     64
     65When the view is changed to have a coalesce, the coalesce value appears in the ORM.
     66{{{
     67blxa=> create view blxadmin_nextschedule as select row_number() over (order by scheduled) as id, scheduled, exact_schedule_id, coalesce(v.id, 0) as negative_schedule_id from (select '2022-03-21'::date + '01:00:00'::time as scheduled, 1 as exact_schedule_id) as u left join blxadmin_negativeschedule as v on (u.scheduled between v.from_datetime and v.to_datetime)  order by scheduled asc;
     68CREATE VIEW
     69blxa=> select * from blxadmin_nextschedule ;
     70 id |      scheduled      | exact_schedule_id | negative_schedule_id
     71----+---------------------+-------------------+----------------------
     72  1 | 2022-03-21 01:00:00 |                 1 |                    1
     73(1 row)
     74}}}
     75
     76{{{
     77>>> NextSchedule.objects.all()[0].scheduled, NextSchedule.objects.all()[0].exact_schedule_id, NextSchedule.objects.get(id=1).negative_schedule_id
     78(datetime.datetime(2022, 3, 21, 1, 0), 1, 0)
     79}}}
Back to Top