📺 Develpreneur YouTube Episode

Video + transcript

Learn Python And Django Day 56

2021-05-11 •Youtube

Detailed Notes

We work on the UX part of the application and create a different look for tasks based on the status.

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

Transcript Text
[Music]
well hello and welcome back
we are continuing our django python
tutorial series of stuff
we are getting near the end of our tasks
and this time we are going to focus on
uh setting the background color
based on status now
now there's a couple of things we need
to look at so let's start with
looking at this task list or any one of
these
uh if we look at tasks or to-do
then we can see either it's active tasks
or
list tasks and i think we're going to
find that both of those
active tasks uses task lists and
what was the other task list
probably also uses task lists we see
just about everything does yeah list
tasks so it does so
we're going to go to our list task html
and then here what we're going to do is
we're going to take
this class of tasks which is
a css class let me go look here
so if we look here we inspect
if we pick one then we're going to see
up here
the overall look is a class of tasks
so what we're going to do with this is
we're going to do a task per
status so we're going to do tasks
and essentially we're going to do
is postfix
to that append to that the
status short name so for each one of
these statuses we're going to have a
different style
and with those we can see we're going to
put based on the short name so we've got
five that we have to worry about we'll
use the one that we currently see
uh let's go back over here if we go to
what we currently see let's make that
for
our new so that'll be easy enough to do
and then
notice we have new progress comp
hold and cancel so let's go to our style
real quick
and so currently it's to be tasks new
but we're going to take this
and let's just do this real quick
so we have was it prog
cancel
complete let's go look back real quick
uh prog oh comp hold cancel
okay prog
cancel comp hold
and basically we're going to do now
there's a couple ways we can do this i'm
not going to get into the more
complicated
uh some of the styling things we do but
you can actually have stuff that are
essentially child classes
style classes but for right now we're
going to go with
we're just going to have a separate one
and we're going to be able to do this
actually fairly easy
because we're going to do is we're going
to take the class we'll do tasks and
we're just going to take that short name
and append it to it so now that's gonna
show up
regardless of what we do and actually if
we do this right here
and here we'll be able to see that so if
i just refresh this
so now currently whoop
so we've got something here that's a
little bit off and it's probably
because so we've got tess new but it
didn't pick
up the
new status so which may be a problem for
so let's uh let's kill this off
[Music]
and let's do uh let's see
oops
see if we've got any pycs here
that we want to kill off we do so we
want to do
rm.d dp
dp project migrations
oh we don't really need the pi cache
oh let's go do it anyways see
hi cash star
and then we need
the regular one
and then we need the one that's here
okay so now let's try to run it and see
if
[Music]
so if we run it up so it's still not
picking those up
but for right now we'll we will come
back to those what we first want to see
is
that we're going to have for task new
that's a new let's see
let's go to our task list and what we'll
be able to see
here is if you can see here these are
like
underscore comp underscore new so
let's go ahead and build these out and
it's going to end up catching up with us
when the
style sheet actually kicks in because we
do have a little issue here let's see
so progress let's say so we're going to
do
new is current and that's what we're
going to do so let's do a hold
and let's change this around a bit so
we're going to do the background color
let's make it like a blue
so let's see rgb so if it was like a
d that's going to be blue
and we have another color let's see
so for our regular color
[Music]
oops let's just do our color and for
blue let's just do like a white
so now if we take those two
and let's change that so that was going
to be hold we don't have that but let's
just take this
and let's change those so it's going to
look like that so i don't really like
that oh i'm sorry that's not a white
whoop
darn it so let's go back here
and actually we can change this so let's
take this
whole thing
and so now we're seeing that but what we
want to do is let's change that color to
like about a ddd
uh let's make it a little brighter
that's right two let's do e there we go
so we'll do that
and let's crank that blue down a little
bit
let's make it like a b
let's see what is if we go with an a
it's going to look at five ooh that one
looks pretty good so if we do that
let's do that so there's our colors and
notice the rest stuff we're just going
to keep the same so we're going to take
that and that's our hold
easy enough to do
and so now let's take the same one and
so let's see
so we've got new and we've got hold
let's do cancel and that's going to be
oh darn it let's go back over here so
for that cancel let's make him
uh let's see we're gonna make like a
really dark
text but the background is going to be
uh let's do it like uh let's do 777 and
see what that does
so there we go we can do that so if it's
cancelled
we're going to do these two
and that's our cancel
and then let's see so
let's do uh we're gonna do
so our in progress let's say complete is
gonna be green
we're going to do like a green here
so here
so complete let's make this a green oh
it's here so let's make the background
color
when we did the blue i think we did like
a
let's do like that oh that looks pretty
good and then we're gonna change
our color here to complete
and let's keep it we can either go
really bright
so let's do like bbb let's do that so
that's going to be our complete
and then
so we've got our complete we've got our
hold we've got our new let's do our
cancel uh we did our cancel and so
in progress let's make this like a i'll
make this like a yellow
let's try whoops let's go over here
save that let's go over here
and let's oops
so let's make the background
uh let's see so that's not it
all right we're gonna have to pick a
yellow here we'll get that in a second
all right let me get a good yellow
rgb code
[Music]
so let's see let's go find one let's do
something
like and let's keep it sort of like this
so
our hex could be uh is that right okay
so fffcc so
found that real quick
[Music]
so if we do that and then our color
becomes
oh i missed an f
there we go and so now we want our color
to be
dark so let's bring this down to like
that 2 2 2 again
that looks pretty good so that means
that that is
uh whoop let's take that
and so now with that in progress change
your color
and then what we have is
something that is a little more colorful
than we had and it's going to show us
as we do this
all right i had to log back in so let me
get
here if i got my task list
uh now it's complaining
and get item so let's see we probably
let's make sure we got this going right
okay so i do have an error and i've got
something here and that's a message
key error message
so if we go to views to 12 okay
something's not right there
oh that's if so
i'm going to check just to do i think
i've got that somewhere
uh i know i've got one of those that i
could steal
okay
so i want if message
and this is not equal to null
then i'm going to do that
and then i should have here okay so
message
equals none
if i can type it right there we go so
we'll just default it to none
and now if i look there we go so now
i've got my tasks
notice these are all complete uh let's
see
if i go to my home
i'm gonna see some i think that are not
complete there we go so these are not
complete
so if i take uh background stats just
don't
change my status let's just go to each
of them so that was new if i go to in
progress and save
record and i get that
if i change it to complete oh i've got
that if i change it to hold
then i'm going to see that there and if
i change it to
cancel
and then we see it cancelled so now i
can see my stat tie
based on that and this is going to be
complete
and got it done we'll throw some time in
on this
spent my 15 minutes basically and now
we have one task last task left
uh time frame does not show child count
when deleted
and so what we need to do is we need to
go back into this
and we'll probably have to look at our
roadmap
and let's say here we're going to
actually delete
this guy
and what it should do well no we're
probably going to pick something else so
we'll pick a different one we're going
to create one and create a couple
children
and that will wrap up our time here and
then we're going to move on to actually
deploying this
out and uh be wrapping this one up and
go into our next
whatever our next series of tutorials
will be so we're getting to the end
hold on one more time and we will be
there but as always
until then go out there have yourself a
great day
and we will talk to you next time
you
Transcript Segments
0.93

[Music]

26.48

well hello and welcome back

28.08

we are continuing our django python

31.279

tutorial series of stuff

33.68

we are getting near the end of our tasks

36.239

and this time we are going to focus on

38.559

uh setting the background color

40.399

based on status now

44.96

now there's a couple of things we need

46

to look at so let's start with

48

looking at this task list or any one of

50.48

these

51.36

uh if we look at tasks or to-do

54.719

then we can see either it's active tasks

57.12

or

58.879

list tasks and i think we're going to

60.64

find that both of those

62.719

active tasks uses task lists and

67.92

what was the other task list

72.32

probably also uses task lists we see

74.799

just about everything does yeah list

76.08

tasks so it does so

77.439

we're going to go to our list task html

80.64

and then here what we're going to do is

83.84

we're going to take

84.64

this class of tasks which is

88

a css class let me go look here

91.92

so if we look here we inspect

95.439

if we pick one then we're going to see

98.88

up here

99.52

the overall look is a class of tasks

104

so what we're going to do with this is

105.36

we're going to do a task per

107.04

status so we're going to do tasks

110.479

and essentially we're going to do

113.52

is postfix

116.56

to that append to that the

119.759

status short name so for each one of

122.079

these statuses we're going to have a

123.52

different style

125.759

and with those we can see we're going to

127.92

put based on the short name so we've got

129.52

five that we have to worry about we'll

132.08

use the one that we currently see

134.959

uh let's go back over here if we go to

137.28

what we currently see let's make that

138.64

for

139.04

our new so that'll be easy enough to do

142.64

and then

144.4

notice we have new progress comp

147.52

hold and cancel so let's go to our style

151.04

real quick

153.44

and so currently it's to be tasks new

156.319

but we're going to take this

157.92

and let's just do this real quick

161.519

so we have was it prog

165.519

cancel

169.28

complete let's go look back real quick

173.68

uh prog oh comp hold cancel

176.879

okay prog

180.08

cancel comp hold

186.08

and basically we're going to do now

187.28

there's a couple ways we can do this i'm

188.48

not going to get into the more

189.36

complicated

190.879

uh some of the styling things we do but

192.48

you can actually have stuff that are

195.28

essentially child classes

198.959

style classes but for right now we're

201.519

going to go with

202.64

we're just going to have a separate one

204.319

and we're going to be able to do this

205.44

actually fairly easy

207.2

because we're going to do is we're going

208.159

to take the class we'll do tasks and

210.159

we're just going to take that short name

211.44

and append it to it so now that's gonna

213.2

show up

214.319

regardless of what we do and actually if

216.159

we do this right here

218.72

and here we'll be able to see that so if

222.959

i just refresh this

225.76

so now currently whoop

228.799

so we've got something here that's a

230.48

little bit off and it's probably

233.04

because so we've got tess new but it

237.04

didn't pick

237.76

up the

241.439

new status so which may be a problem for

244.4

so let's uh let's kill this off

246.85

[Music]

249.84

and let's do uh let's see

258.079

oops

261.759

see if we've got any pycs here

267.04

that we want to kill off we do so we

269.84

want to do

271.8

rm.d dp

275.04

dp project migrations

279.12

oh we don't really need the pi cache

282.639

oh let's go do it anyways see

288.4

hi cash star

293.68

and then we need

296.72

the regular one

304.24

and then we need the one that's here

310

okay so now let's try to run it and see

313.36

if

315.54

[Music]

318.56

so if we run it up so it's still not

322.08

picking those up

323.039

but for right now we'll we will come

326.639

back to those what we first want to see

328.4

is

329.84

that we're going to have for task new

331.68

that's a new let's see

334.16

let's go to our task list and what we'll

337.36

be able to see

338.479

here is if you can see here these are

341.28

like

341.6

underscore comp underscore new so

345.36

let's go ahead and build these out and

348

it's going to end up catching up with us

349.6

when the

351.12

style sheet actually kicks in because we

353.6

do have a little issue here let's see

355.44

so progress let's say so we're going to

358.16

do

360.4

new is current and that's what we're

362.16

going to do so let's do a hold

364.88

and let's change this around a bit so

366.639

we're going to do the background color

368.479

let's make it like a blue

371.199

so let's see rgb so if it was like a

374.96

d that's going to be blue

378.88

and we have another color let's see

385.84

so for our regular color

388.18

[Music]

392.639

oops let's just do our color and for

396.24

blue let's just do like a white

404.4

so now if we take those two

408

and let's change that so that was going

409.44

to be hold we don't have that but let's

411.84

just take this

415.919

and let's change those so it's going to

417.919

look like that so i don't really like

419.12

that oh i'm sorry that's not a white

420.479

whoop

421.199

darn it so let's go back here

426.639

and actually we can change this so let's

429.599

take this

430.24

whole thing

437.599

and so now we're seeing that but what we

439.12

want to do is let's change that color to

441.52

like about a ddd

445.919

uh let's make it a little brighter

451.599

that's right two let's do e there we go

454.24

so we'll do that

455.44

and let's crank that blue down a little

457.36

bit

458.8

let's make it like a b

462

let's see what is if we go with an a

466.4

it's going to look at five ooh that one

468.56

looks pretty good so if we do that

472

let's do that so there's our colors and

474.72

notice the rest stuff we're just going

476

to keep the same so we're going to take

477.52

that and that's our hold

483.44

easy enough to do

488.4

and so now let's take the same one and

490.639

so let's see

491.599

so we've got new and we've got hold

495.039

let's do cancel and that's going to be

502.08

oh darn it let's go back over here so

505.68

for that cancel let's make him

508.96

uh let's see we're gonna make like a

511.919

really dark

514.56

text but the background is going to be

521.76

uh let's do it like uh let's do 777 and

526.24

see what that does

527.279

so there we go we can do that so if it's

529.76

cancelled

530.56

we're going to do these two

539.92

and that's our cancel

546.16

and then let's see so

552.8

let's do uh we're gonna do

556.08

so our in progress let's say complete is

560

gonna be green

561.36

we're going to do like a green here

565.76

so here

570.959

so complete let's make this a green oh

574.48

it's here so let's make the background

577.839

color

578.8

when we did the blue i think we did like

580.48

a

582

let's do like that oh that looks pretty

583.6

good and then we're gonna change

585.04

our color here to complete

591.44

and let's keep it we can either go

593.04

really bright

595.44

so let's do like bbb let's do that so

598.32

that's going to be our complete

608.24

and then

612

so we've got our complete we've got our

614.24

hold we've got our new let's do our

618.88

cancel uh we did our cancel and so

622

in progress let's make this like a i'll

624.16

make this like a yellow

627.2

let's try whoops let's go over here

631.12

save that let's go over here

635.44

and let's oops

639.44

so let's make the background

644.88

uh let's see so that's not it

652

all right we're gonna have to pick a

653.12

yellow here we'll get that in a second

662

all right let me get a good yellow

665.68

rgb code

667.49

[Music]

670.079

so let's see let's go find one let's do

673.519

something

674

like and let's keep it sort of like this

678.399

so

678.72

our hex could be uh is that right okay

681.279

so fffcc so

683.04

found that real quick

688.69

[Music]

693.519

so if we do that and then our color

695.839

becomes

698

oh i missed an f

702.079

there we go and so now we want our color

704.959

to be

705.36

dark so let's bring this down to like

707.44

that 2 2 2 again

710.24

that looks pretty good so that means

712.399

that that is

715.279

uh whoop let's take that

723.519

and so now with that in progress change

726.399

your color

728.88

and then what we have is

732.8

something that is a little more colorful

734.8

than we had and it's going to show us

737.36

as we do this

741.76

all right i had to log back in so let me

744.56

get

745.6

here if i got my task list

748.959

uh now it's complaining

753.44

and get item so let's see we probably

757.12

let's make sure we got this going right

771.04

okay so i do have an error and i've got

774.48

something here and that's a message

777.12

key error message

782.16

so if we go to views to 12 okay

786.88

something's not right there

790.399

oh that's if so

793.519

i'm going to check just to do i think

795.279

i've got that somewhere

799.04

uh i know i've got one of those that i

802.639

could steal

808

okay

812

so i want if message

815.92

and this is not equal to null

820.72

then i'm going to do that

826.399

and then i should have here okay so

828.56

message

830.16

equals none

834.8

if i can type it right there we go so

836.48

we'll just default it to none

839.04

and now if i look there we go so now

841.92

i've got my tasks

843.279

notice these are all complete uh let's

846.399

see

846.959

if i go to my home

850.32

i'm gonna see some i think that are not

851.76

complete there we go so these are not

853.6

complete

854.72

so if i take uh background stats just

857.36

don't

857.92

change my status let's just go to each

859.279

of them so that was new if i go to in

860.959

progress and save

862

record and i get that

867.36

if i change it to complete oh i've got

869.76

that if i change it to hold

873.92

then i'm going to see that there and if

875.92

i change it to

877.04

cancel

880.959

and then we see it cancelled so now i

882.72

can see my stat tie

885.199

based on that and this is going to be

886.639

complete

889.68

and got it done we'll throw some time in

892.16

on this

893.6

spent my 15 minutes basically and now

897.519

we have one task last task left

900.959

uh time frame does not show child count

903.12

when deleted

906

and so what we need to do is we need to

908.399

go back into this

909.44

and we'll probably have to look at our

910.839

roadmap

912.72

and let's say here we're going to

915.199

actually delete

916.399

this guy

919.92

and what it should do well no we're

922.639

probably going to pick something else so

923.839

we'll pick a different one we're going

924.8

to create one and create a couple

926.72

children

927.36

and that will wrap up our time here and

930.24

then we're going to move on to actually

931.68

deploying this

932.399

out and uh be wrapping this one up and

935.759

go into our next

936.8

whatever our next series of tutorials

938.24

will be so we're getting to the end

940.16

hold on one more time and we will be

942.399

there but as always

943.6

until then go out there have yourself a

945.68

great day

946.639

and we will talk to you next time

965.44

you