📺 Develpreneur YouTube Episode

Video + transcript

Learn Python And Django Day 54

2021-05-04 •Youtube

Detailed Notes

We continue using the application as a way to track the tasks we have chosen for bug fixing and improving the user experience. This session is aimed at setting default task status and adjust todo vs. active tasks.

You can view source for today and all prior days by reviewing the tag Day 54 at this GitHub: https://github.com/robbroadhead/develpreneur-pythontutorial

Transcript Text
[Music]
well hello and welcome back
we're continuing working through our
task list here from our
uat testing and uh just usability and
user experience stuff
we're going to continue moving through
this actually last episode we added this
little filter
to our active tasks and that actually
is not the ticket we worked on a
slightly different ticket so we're going
to knock that one out
oh mark that complete but we are going
to go it was our task list
and we can see that we sort of got that
working so we're going to fix that up
and this one's tasks
we're going to take essentially the same
code list tasks
and we're going to be able to fix that
so the first one we had was i think
i'm sorry was active tasks
so active tasks all we did is we added
this options and a pid
and so we want to do the same thing for
list
tasks right that's what we call that
list tasks
and so now what we need is we need two
things we need
the ops
which is going to be ops
and we need our pid
it's going to be pid and we're going to
have to pull that now so our
pid
equals zero and then we'll actually just
there we go we can check it here
and then if it's there then
oh there we go that's all we need
and then oh well actually i think well
here becomes interesting thing is that
now we were jumping
and we were based on two things
we're either based on
because now what we're going to see is
that here this all task is actually
going to return
us to to do so if i load that up
and i pick one see it returns to to do
so i need to either return to
um i have to return to where i came from
so either have to return to tasks
or return to to do
and so what i probably the easiest way
to do this is i am just
going to set that when i come in
so i'm going to be i'm just going to
call that a page
and in this case this is going to be
list
well actually i can do it from here
it's either going to be tasks
or it's going to be to do so if i do
what is it active tasks
here the page is going to be to do
and so i'm going to change just a little
bit so i'm going to go into my
task list
and then select time frame it's going to
need
a page and when i do that
where did i do that on my selector
there we go select that that's going to
be
page
and then the id uh let's
do it we're gonna do it this way so
we're gonna do
that we're gonna change this a little
bit so it's gonna be plus page
and then the id
so now we got to change our url
when we did that so this is now going
to be
first thing is going to be a i believe
we call it i think it's just a
str yep and this is going to be page
and then if i go to my views for set
then instead it's going to be let's see
so it needs to become a page
and then here it just needs to be a
redirect to the
page and i think that will take care of
it for us
so now if i go back here and i go to
immediate
uh it is not doing things quite right
so i'm probably breaking something in
the
oh console i'm going to see something's
not right oh to do is not defined
to do is not defined here
uh let's go back and look at what am i
doing here so if i come here
redirect
huh that should be working so it's not
here so it must be
in this uh if i go to
uh where i go to my task list
so let's just do this let's just make
sure it's getting built right
let's see if i'm getting that far
oh that's the problem is it's not
in a string uh let's see select time
frame that should be
like that
and then if we do this and we go to
immediate
there we go if we go to march there's
nothing if we go to our task list
it's going to start off with everything
but if we go to march
it is not giving us what we want so
something's not right there
it's coming to the right place
oh because this task is not actually
it's not doing a filter
my mistake so because remember we
so tasks is all tasks
so if we go to active tasks we do this
little
filter uh let's see
which is basically right here
and now we're gonna essentially do the
same thing actually let's get our count
too
uh cancel complete blah blah blah blah
so then if we go to
uh list tasks
then here see we do a clean session
and then we jump in and grab it
so here we're going to do stuff a little
differently
so when we do alt i think we're going to
skip the clean session
we're going to take that
okay so we've got our process id so we
don't need that
now we're essentially doing the same
thing here on our to do
except i don't need complete
and i think that will work so i get my
count
let me go ahead and send my count
i can just call it count
link the tasks title is all tasks
okay
so if i go home personal goals let's
change it to immediate
let's go to my task list this is going
to be immediate
but it's still not querying it that
quite right
so that's coming through so let's see so
my filter is probably
not quite right let's look here list
tasks
current current is time frame
fp is in my request session so let's
check that i may have cleared that out
so now if i go to march
it's doing that but it's not listing
tasks right
oh shoot
because i turned around and did that
okay so now
let's see
if i do march there's no tasks available
i go immediate there's 20 and i'm gonna
see uh there we go so i'm seeing new i'm
seeing complete
i'm seeing all of that so now
and go back to my to-do i got those
things
knocked out so let's take a look at
i had an error
let's default the status on creating a
task
so if i do create task i don't have
the status set i want it to be new by
default
so that should be easy enough when i do
it's probably create task
and then here uh it uses task
edit so what i need to do is
if it's a new task
then i want to set that so let's do
i don't want to do this because it's
going to be edit or not
and then i'm just going to set it here
i'm going to actually set it within the
task edit so i'm going to say here
edit task
and so actually i'm just going to set it
there i'm going to say
in my view so see this is create task
i'm creating here
so i've got a form instance equals data
and then did i set the data anywhere
date equals here
so i've got the owner and i'm just going
to be say data dot
status equals
new and new equals
and i've got that somewhere where do i
have that let's do a status complete
there we go whoops
here we go oh except for i used it there
but i did it better here we go
so i'm going to take that
and here
oh new equals
whoop
and then i just want it to be here
and so now if i come in and create a new
task
uh status is new there we go but if i
edit a task
it's going to be oh that's not what i
want i want a status
let me look at something that's
different march doesn't have any
february doesn't have any
professional gold nope
oh because these are active my mistake
let's go to task list
and go to immediate and if i go here
let's do something that's complete
so status is complete
and actually let's take a look at that
uh so if i do the default status on
create task
let's set him to save record there
immediate all tasks active tasks
should be there we go so that's in
progress
and now one of the things we're going to
do
which i have not actually mentioned yet
is let's change
based on status so let's do uh so
default status on that
and this is what we're going to come to
next time is i want to change this so
these colors actually show us something
so i'm going to create a task and this
is going to be
set task background color
based on status just to make it a little
easier
new blah blah blah and
we're going to save that so now if we go
here
should see somewhere background color
based on that all right so we added a
task and we
completed one but that will wrap it up
for this one and we will come back next
time and continue
digging through our list as always go
out there have yourself
a great day
you
Transcript Segments
0.62

[Music]

26.32

well hello and welcome back

27.92

we're continuing working through our

29.359

task list here from our

31.439

uat testing and uh just usability and

35.12

user experience stuff

36.96

we're going to continue moving through

38.32

this actually last episode we added this

40.8

little filter

41.92

to our active tasks and that actually

45.039

is not the ticket we worked on a

46.96

slightly different ticket so we're going

48.32

to knock that one out

49.6

oh mark that complete but we are going

52.16

to go it was our task list

54.16

and we can see that we sort of got that

55.84

working so we're going to fix that up

58.239

and this one's tasks

61.52

we're going to take essentially the same

63.199

code list tasks

65.119

and we're going to be able to fix that

66.479

so the first one we had was i think

68.88

i'm sorry was active tasks

72.08

so active tasks all we did is we added

75.6

this options and a pid

79.2

and so we want to do the same thing for

81.68

list

82.24

tasks right that's what we call that

87.52

list tasks

92.56

and so now what we need is we need two

94.56

things we need

95.759

the ops

98.88

which is going to be ops

104.479

and we need our pid

109.68

it's going to be pid and we're going to

110.96

have to pull that now so our

113.2

pid

116.479

equals zero and then we'll actually just

120.64

there we go we can check it here

126.24

and then if it's there then

129.52

oh there we go that's all we need

133.28

and then oh well actually i think well

136

here becomes interesting thing is that

137.68

now we were jumping

139.52

and we were based on two things

142.72

we're either based on

146.4

because now what we're going to see is

148.16

that here this all task is actually

150

going to return

150.64

us to to do so if i load that up

153.92

and i pick one see it returns to to do

157.12

so i need to either return to

161.04

um i have to return to where i came from

163.28

so either have to return to tasks

164.959

or return to to do

168

and so what i probably the easiest way

169.599

to do this is i am just

171.599

going to set that when i come in

179.36

so i'm going to be i'm just going to

180.959

call that a page

186.48

and in this case this is going to be

189.28

list

190

well actually i can do it from here

193.519

it's either going to be tasks

198.879

or it's going to be to do so if i do

203.599

what is it active tasks

209.68

here the page is going to be to do

215.599

and so i'm going to change just a little

217.519

bit so i'm going to go into my

219.84

task list

223.44

and then select time frame it's going to

226.48

need

226.879

a page and when i do that

231.2

where did i do that on my selector

234.959

there we go select that that's going to

237.68

be

238.84

page

243.12

and then the id uh let's

246.239

do it we're gonna do it this way so

249.84

we're gonna do

250.56

that we're gonna change this a little

251.519

bit so it's gonna be plus page

257.359

and then the id

260.88

so now we got to change our url

264.88

when we did that so this is now going

268

to be

271.36

first thing is going to be a i believe

273.68

we call it i think it's just a

275.759

str yep and this is going to be page

281.759

and then if i go to my views for set

289.759

then instead it's going to be let's see

293.04

so it needs to become a page

298.08

and then here it just needs to be a

299.759

redirect to the

302.88

page and i think that will take care of

305.12

it for us

308.08

so now if i go back here and i go to

310.24

immediate

312.56

uh it is not doing things quite right

318.32

so i'm probably breaking something in

322.84

the

324.479

oh console i'm going to see something's

326.24

not right oh to do is not defined

331.28

to do is not defined here

341.52

uh let's go back and look at what am i

343.12

doing here so if i come here

345.759

redirect

350.4

huh that should be working so it's not

354.56

here so it must be

355.84

in this uh if i go to

363.44

uh where i go to my task list

371.84

so let's just do this let's just make

374.24

sure it's getting built right

381.84

let's see if i'm getting that far

386.56

oh that's the problem is it's not

389.6

in a string uh let's see select time

392.639

frame that should be

395.84

like that

399.039

and then if we do this and we go to

401.68

immediate

403.44

there we go if we go to march there's

406.56

nothing if we go to our task list

408.88

it's going to start off with everything

410.24

but if we go to march

413.52

it is not giving us what we want so

415.36

something's not right there

419.68

it's coming to the right place

423.36

oh because this task is not actually

426

it's not doing a filter

427.599

my mistake so because remember we

431.36

so tasks is all tasks

435.36

so if we go to active tasks we do this

438.96

little

439.52

filter uh let's see

443.919

which is basically right here

448.319

and now we're gonna essentially do the

449.759

same thing actually let's get our count

451.44

too

452.639

uh cancel complete blah blah blah blah

454.4

so then if we go to

456.96

uh list tasks

460.639

then here see we do a clean session

465.44

and then we jump in and grab it

470.56

so here we're going to do stuff a little

476.84

differently

479.84

so when we do alt i think we're going to

481.36

skip the clean session

482.879

we're going to take that

489.28

okay so we've got our process id so we

491.12

don't need that

498.319

now we're essentially doing the same

500

thing here on our to do

501.759

except i don't need complete

508.8

and i think that will work so i get my

511.36

count

512.88

let me go ahead and send my count

516.88

i can just call it count

522.399

link the tasks title is all tasks

526.16

okay

531.36

so if i go home personal goals let's

535.12

change it to immediate

536.56

let's go to my task list this is going

538.88

to be immediate

541.279

but it's still not querying it that

543.519

quite right

544.399

so that's coming through so let's see so

547.04

my filter is probably

548

not quite right let's look here list

550

tasks

552.32

current current is time frame

560.24

fp is in my request session so let's

562.48

check that i may have cleared that out

565.2

so now if i go to march

568.959

it's doing that but it's not listing

570.56

tasks right

572.72

oh shoot

575.839

because i turned around and did that

578.08

okay so now

580.64

let's see

584.48

if i do march there's no tasks available

587.2

i go immediate there's 20 and i'm gonna

589.279

see uh there we go so i'm seeing new i'm

591.44

seeing complete

593.2

i'm seeing all of that so now

596.959

and go back to my to-do i got those

599.36

things

600.16

knocked out so let's take a look at

603.279

i had an error

606.32

let's default the status on creating a

608.48

task

609.519

so if i do create task i don't have

613.04

the status set i want it to be new by

615.44

default

617.12

so that should be easy enough when i do

620.8

it's probably create task

624.24

and then here uh it uses task

628

edit so what i need to do is

632.8

if it's a new task

635.839

then i want to set that so let's do

640.24

i don't want to do this because it's

641.44

going to be edit or not

646.56

and then i'm just going to set it here

648.399

i'm going to actually set it within the

650.72

task edit so i'm going to say here

656.64

edit task

661.279

and so actually i'm just going to set it

662.8

there i'm going to say

664.399

in my view so see this is create task

668.88

i'm creating here

672.24

so i've got a form instance equals data

676.24

and then did i set the data anywhere

678.16

date equals here

679.36

so i've got the owner and i'm just going

680.64

to be say data dot

683.12

status equals

686.839

new and new equals

690.56

and i've got that somewhere where do i

692.48

have that let's do a status complete

695.519

there we go whoops

699.2

here we go oh except for i used it there

702.64

but i did it better here we go

706.24

so i'm going to take that

709.92

and here

715.36

oh new equals

719.519

whoop

723.68

and then i just want it to be here

728.88

and so now if i come in and create a new

732.24

task

733.68

uh status is new there we go but if i

736.72

edit a task

738.24

it's going to be oh that's not what i

740

want i want a status

742.72

let me look at something that's

744

different march doesn't have any

745.92

february doesn't have any

747.92

professional gold nope

751.2

oh because these are active my mistake

752.8

let's go to task list

755.92

and go to immediate and if i go here

758.48

let's do something that's complete

760.56

so status is complete

765.519

and actually let's take a look at that

766.959

uh so if i do the default status on

768.8

create task

770.639

let's set him to save record there

774.48

immediate all tasks active tasks

778.16

should be there we go so that's in

779.76

progress

782.399

and now one of the things we're going to

784.959

do

785.44

which i have not actually mentioned yet

788.48

is let's change

794.48

based on status so let's do uh so

797.279

default status on that

798.639

and this is what we're going to come to

799.68

next time is i want to change this so

800.88

these colors actually show us something

803.2

so i'm going to create a task and this

805.6

is going to be

806.48

set task background color

813.04

based on status just to make it a little

816.16

easier

818.399

new blah blah blah and

821.839

we're going to save that so now if we go

826.839

here

828.16

should see somewhere background color

829.92

based on that all right so we added a

831.44

task and we

832.639

completed one but that will wrap it up

835.04

for this one and we will come back next

836.639

time and continue

838.24

digging through our list as always go

840.56

out there have yourself

841.76

a great day

859.12

you