📺 Develpreneur YouTube Episode

Video + transcript

Learn Python And Django Day 43

2021-03-25 •Youtube

Detailed Notes

This tutorial is part two of some debugging steps and moving the UX form buttons to some clickable DIVs.

You can view source for today and all prior days by reviewing the tag Day 43 at this GitHub (this one includes day 42 as well): https://github.com/robbroadhead/develpreneur-pythontutorial

Transcript Text
[Music]
well hello and welcome back
we are continuing doing some uh some
debugging basically uh based on some of
the session variables we set
and we are going to dive right into a
couple of things that we want to work
through now from a
navigation point as well now we can get
to our tasks
by going through a roadmap then a time
frame
and then clicking down into a task and
in this case
we can return back to our time frame and
we're good
however if we come from a task list
then we don't really want to do this
when we're able to return to the task
list
if we come from our home page
this is actually our to-do list and we'd
want to be able to return to
our to-do so what we can do is we can
and we can leave those up there we can
do this annual personal goals which of
course we can go to our lists
pretty easily so what we probably want
to do
is come in and just allow this return to
per annual personal goals
let's make that work and the reason it
doesn't
is when we come through road map as we
drill our way down in
this one works and we get our time frame
equals one so that's being set right
but if we go from our task list and we
return
then we're getting it does not exist but
it's not because our time frame so our
time frame is correct
what we have to actually look into here
is we'll see that our oops here our road
map
is not correct because it's having an
issue with that and probably because
that's going to be none we ran into that
before so we're going to look at the
same thing
basically here where we did it before
with our we're editing a task and we're
checking to see if it existed
then we also need to do in the edit
roadmap
i'm sorry edit time frame probably
uh edit time frame let's just do it this
way
edit time add a task edit time frame
then we're going to see again if it's in
the session but it
also we need to check
so i'm gonna do that same one if the r
mid we gotta make sure if it's none
or not because we're not actually
removing it from the session when we
clean it
instead we're setting it equal to none
and so i think that's the only place we
checked that so now
uh we're gonna see a different one and
so
this is the list object has no attribute
id so if we look
at here that time frame id probably
isn't getting set right
so let's look at 278 and it's probably
the same issue
oh id oh because we have
a roadmap.id but we need to create
i need to do it like this actually
or
let's do this
let's see so the road map we know
because we're coming in from the time
frame so we can actually
build that so if there's not a road map
there then we
actually can pull it from
i believe does our time frame point to a
road map if it does and let's just put
it does
so here road map equals
none uh
actually we don't even need to work yeah
so we want to do that because here it's
equal to
that otherwise
we want it to be equal to so if it's in
the session we're going to use that one
else and actually we probably need to do
this anyways
let's just we can actually just do it
this way because we've got
our oh this would be if it was new
so that's going to be in our session
otherwise
it's going to be equal to
our object itself which is data
dot road map
so if we look here let's see
that annual personal goals should be
able to still have
same one oh we don't have it right
so data may not be correct
well let's do it this way
when we do the get we'll just do it up
here because i think we're not getting
it let's see that's record deleted
i think i called it roadmap let's make
sure real quick up roadmap with the
lower
i don't know because we had its proper
name
oh that's a verb okay
let's see if this works it's a case
suggestion
and if we do this now now we're back to
this
so we're missing something else in here
it is missing
there's no attribute id oh time frame id
are we not getting that set right we may
not be
oh that would be the parent
and so from up here so we've got id
which is the time frame
did we reset it we did not
it's like we're missing something on one
of these
oh probably this roadmap
does not have an id
so if we look at roadmap are we getting
it built we have none
oh shoot i don't need that
because i just blanked it out my mistake
silly mistake now we're running and we
have this going so now we should be able
to
do this return annual personal goals
which it does if we go to tax
task lists time frame should be you know
personal goals
and yes it refers to it so now we've got
those cleaned up
so now we can actually walk through our
all of our tasks
and we can actually push them up and
down and do what we need to
now we had some
that here i think we missed some of our
count so if we look here that looks
pretty good if we go here
oh that's what we want to do uh one of
the things we're doing is we're
going to show the number of tasks here
but i think i'm going to leave that for
now i want to clean this thing up so i
want to go back to basically my general
edit
and i'm going to clean this up a little
bit
and what i want to do is
uh let's see i want to actually like
slide this over and clean it up so it
looks a little bit more
like
it sort of flows with the other stuff so
what we've got here
is if we look at our card
here we've got this
table that's got a width of 80. but what
i want to do
is let's make it uh let's center it
so it's going to be 95
and let's change our border color to
maybe match what we've got up top
so if we look at
uh let's do it let's see maybe we'll
just do
a gray and see what that looks like
actually let's start with the black
look at that that looks a little bit
better what we want to do is we want to
get some spacing around some of this
and so uh
let's take that actually let's go ahead
to 100
and let's change it to this color so if
we look at this color
it is this
and so let's go back to our card
uh our table let's see if this looks a
little better if we do it this way
so now we've got this darker red and so
it looks a little bit better
and then what we want to do is within
our table
uh where did that go after our
i don't table if i can do it from here
well i'm going to space this out a
little bit
and i'm going to change these so that
they are i think we called it thing
called a button task
and we want to let's change that up a
little bit
so we're going to create a button form
so let's start with this
so let's go to this table
and well let's just take that and so
this is on edit task
well go over here edit task
that's task list don't need that up uh
let's see
well i can do this see road map edit has
that table
same kind of thing
okay let me go back over to here for
some reason i didn't pick that up
copy the element
let's see if this works a little better
i don't know what oh it's not copying
that
sorry i don't want to copy the element
i want to copy the
oh because it was doing the whole thing
can i just copy no
let's see if i can do it this way nope
it doesn't want it so let's just copy
the color
and then we'll fix the rest of it so
let's do the whoop wrong one so let's do
this here
that's going to be 100 color is going to
be red
and we want to see the same thing for
basically all of our edits
come in here table
and time frame edit we do the same thing
oh except for heat time frame that it is
not working off of that so we're good oh
because he doesn't have
his forms up here there we go
there's our edits so now we've cleaned
that up
so everywhere that's going to look like
that let's say let's work on these
buttons a little bit
and actually with this table
and this is on because we're going to do
this for edit task we'll start with the
edit task
is we've got this button and let's do
a little break here so that gives us
even if we have this
we're going to have at least now a
little bit of space there
and actually let's do it this way let's
do it only
if we have a button and then here we're
going to do
a break before we get our little uh
and let's and we'll leave them there but
let's do class equals
and this will be button edit
and let's change those a little bit so
let's go to our button edit
and we're going to have to we'll get
this changed because then it's going to
take a little while for this thing to
jump back in
so if we go check for our buttons we
have a button task
and let's make this our button
do our button edit
and let's make that
uh let's see let's go back and look at
our task one
so that was pretty good so let's take a
look at
that and so that was the text was one
color and we had that dark
gray so let's actually change this
around a little bit
for button edit let's take the
background color
let's see the text color is that red
so that's gonna be now my background
color
and let me let's make the color
uh pretty bright
and we'll keep the border color oh we're
going to expand the width
and so let's see if it'll actually pick
this up yet probably won't
and that was on edit a task
so they're not it's not picking that up
yet so we'll have to pick that up next
time around
which is good because we've hit our time
limit for today and we're going to clean
up these buttons a little bit
as you see we're spacing stuff out a
little bit um
that did not pick up whoops
task edit let's make sure we've got that
return to parent let's give it an extra
one
space a little bit i may not have saved
that right
there we go so we've got a little bit
more space here
and we're going to clean up this and
we're going to come back around and
start actually building out
uh walk through and actually do some
tasks get some stuff completed
next thing we want to do is add some
reports so we're getting there
but until next time have yourself a
great day a great week
and we will talk to you at that point
you
Transcript Segments
0.63

[Music]

26.16

well hello and welcome back

28.08

we are continuing doing some uh some

30.08

debugging basically uh based on some of

32.32

the session variables we set

34.399

and we are going to dive right into a

36.64

couple of things that we want to work

37.92

through now from a

39.28

navigation point as well now we can get

41.6

to our tasks

43.44

by going through a roadmap then a time

46

frame

46.8

and then clicking down into a task and

49.68

in this case

50.399

we can return back to our time frame and

53.52

we're good

54.399

however if we come from a task list

57.68

then we don't really want to do this

59.52

when we're able to return to the task

61.68

list

62.48

if we come from our home page

65.519

this is actually our to-do list and we'd

68.56

want to be able to return to

69.92

our to-do so what we can do is we can

73.6

and we can leave those up there we can

76.96

do this annual personal goals which of

78.72

course we can go to our lists

80.159

pretty easily so what we probably want

82.799

to do

83.84

is come in and just allow this return to

87.119

per annual personal goals

88.88

let's make that work and the reason it

92

doesn't

93.04

is when we come through road map as we

95.759

drill our way down in

98.64

this one works and we get our time frame

101.92

equals one so that's being set right

104.32

but if we go from our task list and we

107.439

return

108.799

then we're getting it does not exist but

110.799

it's not because our time frame so our

112.159

time frame is correct

113.36

what we have to actually look into here

114.799

is we'll see that our oops here our road

117.04

map

118.399

is not correct because it's having an

120.32

issue with that and probably because

122.96

that's going to be none we ran into that

126.56

before so we're going to look at the

128.16

same thing

128.8

basically here where we did it before

132.48

with our we're editing a task and we're

135.12

checking to see if it existed

137.44

then we also need to do in the edit

140.08

roadmap

140.879

i'm sorry edit time frame probably

145.36

uh edit time frame let's just do it this

147.52

way

149.599

edit time add a task edit time frame

152.72

then we're going to see again if it's in

155.04

the session but it

156

also we need to check

160.319

so i'm gonna do that same one if the r

162

mid we gotta make sure if it's none

163.519

or not because we're not actually

164.8

removing it from the session when we

166.4

clean it

167.599

instead we're setting it equal to none

171.599

and so i think that's the only place we

173.92

checked that so now

178.48

uh we're gonna see a different one and

180.319

so

181.519

this is the list object has no attribute

184.08

id so if we look

185.28

at here that time frame id probably

189.519

isn't getting set right

192.239

so let's look at 278 and it's probably

195.68

the same issue

202.159

oh id oh because we have

205.92

a roadmap.id but we need to create

213.68

i need to do it like this actually

218.239

or

221.44

let's do this

224.48

let's see so the road map we know

226.64

because we're coming in from the time

227.76

frame so we can actually

229.84

build that so if there's not a road map

232.4

there then we

233.12

actually can pull it from

236.799

i believe does our time frame point to a

239.28

road map if it does and let's just put

241.04

it does

243.76

so here road map equals

247.92

none uh

251.519

actually we don't even need to work yeah

252.959

so we want to do that because here it's

254.64

equal to

255.599

that otherwise

259.919

we want it to be equal to so if it's in

262.96

the session we're going to use that one

264.24

else and actually we probably need to do

266.08

this anyways

271.199

let's just we can actually just do it

275.04

this way because we've got

276.32

our oh this would be if it was new

284.56

so that's going to be in our session

286

otherwise

288.24

it's going to be equal to

294.08

our object itself which is data

299.12

dot road map

306.56

so if we look here let's see

311.759

that annual personal goals should be

313.6

able to still have

315.759

same one oh we don't have it right

319.199

so data may not be correct

325.84

well let's do it this way

329.84

when we do the get we'll just do it up

331.44

here because i think we're not getting

332.639

it let's see that's record deleted

342.4

i think i called it roadmap let's make

343.919

sure real quick up roadmap with the

345.759

lower

349.36

i don't know because we had its proper

350.96

name

352.8

oh that's a verb okay

356.96

let's see if this works it's a case

359.199

suggestion

361.039

and if we do this now now we're back to

364.56

this

365.039

so we're missing something else in here

366.319

it is missing

368.24

there's no attribute id oh time frame id

371.199

are we not getting that set right we may

372.8

not be

380.479

oh that would be the parent

387.6

and so from up here so we've got id

390.8

which is the time frame

396.16

did we reset it we did not

404.8

it's like we're missing something on one

406.639

of these

410.24

oh probably this roadmap

413.68

does not have an id

418

so if we look at roadmap are we getting

419.599

it built we have none

423.52

oh shoot i don't need that

426.96

because i just blanked it out my mistake

430.24

silly mistake now we're running and we

433.12

have this going so now we should be able

435.039

to

435.52

do this return annual personal goals

437.199

which it does if we go to tax

439.039

task lists time frame should be you know

441.039

personal goals

442.4

and yes it refers to it so now we've got

444.639

those cleaned up

446.639

so now we can actually walk through our

449.52

all of our tasks

451.28

and we can actually push them up and

452.96

down and do what we need to

454.8

now we had some

458.16

that here i think we missed some of our

462.4

count so if we look here that looks

464.08

pretty good if we go here

465.919

oh that's what we want to do uh one of

468.08

the things we're doing is we're

469.44

going to show the number of tasks here

473.28

but i think i'm going to leave that for

474.479

now i want to clean this thing up so i

476.4

want to go back to basically my general

478.8

edit

479.919

and i'm going to clean this up a little

481.36

bit

483.199

and what i want to do is

487.28

uh let's see i want to actually like

489.039

slide this over and clean it up so it

490.72

looks a little bit more

492

like

495.28

it sort of flows with the other stuff so

497.12

what we've got here

500.8

is if we look at our card

505.28

here we've got this

508.639

table that's got a width of 80. but what

511.759

i want to do

512.56

is let's make it uh let's center it

516.24

so it's going to be 95

519.76

and let's change our border color to

524.159

maybe match what we've got up top

527.68

so if we look at

532.959

uh let's do it let's see maybe we'll

535.92

just do

536.64

a gray and see what that looks like

538.16

actually let's start with the black

540.959

look at that that looks a little bit

542.72

better what we want to do is we want to

544.399

get some spacing around some of this

548.32

and so uh

551.36

let's take that actually let's go ahead

553.44

to 100

558.48

and let's change it to this color so if

561.519

we look at this color

562.64

it is this

566.32

and so let's go back to our card

569.6

uh our table let's see if this looks a

573.12

little better if we do it this way

577.2

so now we've got this darker red and so

579.36

it looks a little bit better

580.32

and then what we want to do is within

582.16

our table

584.72

uh where did that go after our

589.44

i don't table if i can do it from here

591.2

well i'm going to space this out a

592.48

little bit

594.24

and i'm going to change these so that

597.68

they are i think we called it thing

604.16

called a button task

610.48

and we want to let's change that up a

613.92

little bit

616

so we're going to create a button form

618

so let's start with this

620.56

so let's go to this table

624.24

and well let's just take that and so

626.399

this is on edit task

627.92

well go over here edit task

632

that's task list don't need that up uh

634.399

let's see

636.48

well i can do this see road map edit has

639.44

that table

640.079

same kind of thing

644.839

okay let me go back over to here for

647.76

some reason i didn't pick that up

652.24

copy the element

655.44

let's see if this works a little better

660.959

i don't know what oh it's not copying

663.279

that

664.32

sorry i don't want to copy the element

667.839

i want to copy the

672.32

oh because it was doing the whole thing

675.68

can i just copy no

684.959

let's see if i can do it this way nope

688.16

it doesn't want it so let's just copy

689.6

the color

692.88

and then we'll fix the rest of it so

694.64

let's do the whoop wrong one so let's do

696.72

this here

699.36

that's going to be 100 color is going to

701.68

be red

706.24

and we want to see the same thing for

708

basically all of our edits

711.2

come in here table

716.8

and time frame edit we do the same thing

721.68

oh except for heat time frame that it is

727.279

not working off of that so we're good oh

730

because he doesn't have

731.2

his forms up here there we go

738.72

there's our edits so now we've cleaned

740.8

that up

742.079

so everywhere that's going to look like

743.2

that let's say let's work on these

744.8

buttons a little bit

746.16

and actually with this table

750.32

and this is on because we're going to do

752.399

this for edit task we'll start with the

754

edit task

755.76

is we've got this button and let's do

759.76

a little break here so that gives us

762.48

even if we have this

764.079

we're going to have at least now a

765.04

little bit of space there

767.68

and actually let's do it this way let's

771.519

do it only

773.6

if we have a button and then here we're

776.72

going to do

779.519

a break before we get our little uh

785.2

and let's and we'll leave them there but

788.48

let's do class equals

792.56

and this will be button edit

800.48

and let's change those a little bit so

802

let's go to our button edit

804.56

and we're going to have to we'll get

805.92

this changed because then it's going to

807.279

take a little while for this thing to

808.48

jump back in

810.8

so if we go check for our buttons we

813.36

have a button task

817.76

and let's make this our button

821.68

do our button edit

828.639

and let's make that

833.519

uh let's see let's go back and look at

836

our task one

837.519

so that was pretty good so let's take a

839.04

look at

841.36

that and so that was the text was one

844.399

color and we had that dark

845.76

gray so let's actually change this

847.839

around a little bit

849.04

for button edit let's take the

851.199

background color

852.72

let's see the text color is that red

856.399

so that's gonna be now my background

857.839

color

860.88

and let me let's make the color

864.399

uh pretty bright

867.68

and we'll keep the border color oh we're

869.36

going to expand the width

872.88

and so let's see if it'll actually pick

874.399

this up yet probably won't

879.44

and that was on edit a task

884.72

so they're not it's not picking that up

886.48

yet so we'll have to pick that up next

888.079

time around

888.72

which is good because we've hit our time

890.56

limit for today and we're going to clean

892.32

up these buttons a little bit

893.279

as you see we're spacing stuff out a

894.72

little bit um

896.32

that did not pick up whoops

899.36

task edit let's make sure we've got that

903.76

return to parent let's give it an extra

907.199

one

907.519

space a little bit i may not have saved

910.48

that right

913.04

there we go so we've got a little bit

915.76

more space here

917.12

and we're going to clean up this and

918.88

we're going to come back around and

919.92

start actually building out

921.839

uh walk through and actually do some

923.519

tasks get some stuff completed

925.04

next thing we want to do is add some

926.16

reports so we're getting there

928.56

but until next time have yourself a

930.32

great day a great week

931.839

and we will talk to you at that point

949.68

you