📺 Develpreneur YouTube Episode

Video + transcript

Learn Python And Django Day 38

2021-03-09 •Youtube

Detailed Notes

A side trip down bootstrap and CSS lane to make a few tweaks to the user experience.

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

Transcript Text
[Music]
well hello and welcome back
we are continuing our series of
tutorials on
python and django this episode we are
going to work on
cleaning up our tasks a little bit
finding something a little more useful
we've been
working through road maps and time
frames and getting some of that stuff
put together
our home page if you remember is a list
of active tasks and
we've added enough information that it's
not terribly useful so we're going to
play with that and clean that up a
little bit this time around
so first off
let's see if i can
get this to run there we go okay so
there it's running oh got it running in
two's windows so i don't need that so
let's go here here
boom so this is in to do
and so let's go take a look at that well
actually let's walk through this so to
do
is active tasks if we go to active tasks
then we're going to see here task list
so there's not a whole lot we need to do
that with this
up at the view level we're going to
actually just display out our change
change out our display a little bit
first thing i'm going to do is deal with
these buttons i'm going to do something
a little
more useful with those and because we
have
all this within a single div
i'm going to sort of separate that out a
little bit
and now what i'm going to do is i'm
going to have two divs
one is basically for
the buttons and one is for the others
i'm gonna do it like this so we're gonna
go do
and we'll start with something simple
just to play with it see how it looks
which is not an uncommon thing to do
and i'm going to use let me do this so
there's my two buttons
and i do a break because i'll make sure
these are on different lines
because that is and then i'm going to
use
um a class from bootstrap
and the first part i'm going to do is
going to be
md let's do 8.
and i believe we talked about this
before this is
within bootstrap we've got essentially
12
sections that it splits the screen into
and so we're gonna take the first eight
first two thirds and display most of our
cards
in the buttons gonna be on the second
two thirds so if we just look at that
we're gonna see where it's not showing
oh because it's not within a single row
because we have our
[Music]
because we have our line breaks there so
what we want to do is actually tasks is
also going to be a row
i think that will take care of our
problem
it may not
so he's going to be a row he says that
that should be there
did i save it
let's check that real quick make sure
that we got it i may not have
so it's not picking that up right oh it
may not be picking up
everything correctly it's probably not
picking did i not get my
bootstrap in there i may not have
bootstraps so let's take a look at that
real quick
so we look here and so we're going to
play with this so
okay so that's a row
let's do it within that because i think
we're if we look at this guy
so let's change this a little bit
since that whole thing is going to be a
task we're going to create one more
here
to keep the those two essentially a row
come down here
i think that's right let's probably
balance this out let's see how it looks
there we go so now we've got our
two-thirds and we'll see as we collapse
this
whoops let me oh yeah that's right that
is collapsing
it just takes a while because of that
but we'll see as we collapse here
um it does a couple things that are sort
of ugly but we do eventually get to see
where our buttons just get forced to the
bottom
which is essentially what we want so
let's go back to this because we're
going to keep it at this point mostly
now let's add a little more information
here because we've just got a name a due
date and a status
and a time and what we really want
is we're going to do we're going to
start splitting this up a little bit so
we're going to do this in
twos
and we're going to do another one here
and first we're gonna have the name and
then the second one
we're gonna have the due date
and then we're gonna take this guy
and put him here we're gonna do the same
break we can i could play around with
this all differently but that's just a
nice quick and easy way to do it
and then i'm going to do so that's four
four and let's start
actually let's do it this way let's do
one more two because we're gonna play
around this little bit
and here we talk about the time frame
and this is going to be task dot i
believe we called it parent
no test.timeframe and so let's take a
look at what that
looks like so now if we
access this remember this is actually a
class this could be in order to see how
that comes out
and is there anything else we want to do
for our task
let's see status completion date uh
that's good enough
so actually i think we just do it like
this probably changes around but now
what we've got
is so now we're seeing we've got our
time frame and see how this
wraps because it's in that space of two
we're also wrapping our name
due date time spent so let's move this
around a little bit
and let's take this last one we're gonna
split that to three
i'm gonna take our name and status well
let's see
take due date because i think that
wrapped
so we take a look at due date oh that's
okay so we're going to keep due date and
time spent where they were
gives us seven to play with so let's
open up the time frame one
and the name by two and let's see how
that looks
so now we've got our time frames
uh interesting thing is this one's
coming over a little bit
that may not have the right div on it
but we're seeing that the name is status
and then due date time spent so yeah
here
oh it's because time spent is getting
pushed over i believe so let's take a
look at that
actually let's take a look at it here
and we'll see that he is a four
he is a three if we go to the one above
he's a three
four seven five twelve so what did we do
here we did so oh
because it's an equals three so that's
why it's not looking right we got a typo
so if we do this
and we're going to do that let's change
this button here
this style is
class is equal to button so let's call
it something different
uh class equal to button info let's do a
button let's do task button let's do
button btn
task
and we're going to change this in our
css which is
somewhere up here it's going to create a
btn task
i don't think we have a btn yet oh we do
we have a default
we're going to call this task
and we're going to take it and let's
change this a little bit so let's take
this guy
and we're gonna change here the button
info
um i like the color we'll keep the color
let's change the background color
let's go to something
and let's see we can do this
start playing around with color this way
or we can just pick one
so let's pick
um let's change this a little bit so
let's go we're going to go to our
background color
and we're going to make it let's see ddd
that's very light so let's go a little
darker let's go like aaa
and then let's change our border color
i'm sorry not our border color we can
leave that that'll be fine
we'll change our color from this fff
to this guy
which is this
so we take him and go here
change our border color to that whoops
that's not the one i want i want to
change this color
to that and let's
change that color to
something darker like that and then
we're going to take this and we're going
to add whoops
we're going to do some a little styling
with them so we're going to do
a uh let's do
see based on this let's do a
let me do padding bottom
and let's make this
3 pixels
and spacing bottom
actually it's called what which we want
uh
margin bottom uh let's do margin bottom
let's make him like five pixels
so now we're spreading these out a
little bit
five's probably too much so let's drop
that to about three
and we're going to change the width
come here
well let's sit this way i'm going to
take all of that i'm going to steal that
and that's going to become
my button task
and i'm going to set a width of
i don't know what i want my width to be
let's set it to 50 pixels and see what
it looks like
so if i do that and then reset
it did not reload my static so i'm going
to come in here
and reload it and let's see how it looks
here okay did i not get my
oh wait
let's take a look at that
if i look at that button
i go up here
may not have his stuff right so let's
take a look real quick here
uh he's a bt in task
and if i go to my task list whoops
he's a btn task class
so he's getting what he needs
but i do want to change him to
i go to 70
and i want font size
to be
let's go to smaller like that
so let's take those two
and put those here i believe there we go
got a warning in here somewhere
should be text line
see if we get any others oh we do menu
item
that's fine okay so save it
and we probably have to reload that
window
for some reason it's not reloading our
css though
we're going to leave that for now i'm
going to come back to it mostly because
we're running out of time so
first thing we want to do is move some
of this stuff around
see where our time frames are
so we can see those and get into those
we can do our edits
and dive into those we're going to clean
up a couple of these other things like
here
we've got a task list do a little more
clean up next time around and start
walking through this application and
just see what additional changes we can
make
so that'll do it for now have yourself a
great day
and we will talk to you next time
you
Transcript Segments
0.46

[Music]

26.4

well hello and welcome back

28

we are continuing our series of

29.84

tutorials on

31.199

python and django this episode we are

33.84

going to work on

34.96

cleaning up our tasks a little bit

36.8

finding something a little more useful

38.239

we've been

38.96

working through road maps and time

41.04

frames and getting some of that stuff

42.399

put together

43.68

our home page if you remember is a list

46.64

of active tasks and

48.559

we've added enough information that it's

50.96

not terribly useful so we're going to

52.559

play with that and clean that up a

54.239

little bit this time around

56.399

so first off

59.6

let's see if i can

64.32

get this to run there we go okay so

66.159

there it's running oh got it running in

67.84

two's windows so i don't need that so

69.439

let's go here here

70.88

boom so this is in to do

74.88

and so let's go take a look at that well

77.52

actually let's walk through this so to

79.04

do

80.08

is active tasks if we go to active tasks

85.04

then we're going to see here task list

87.92

so there's not a whole lot we need to do

89.36

that with this

90.96

up at the view level we're going to

91.92

actually just display out our change

93.68

change out our display a little bit

95.68

first thing i'm going to do is deal with

98.079

these buttons i'm going to do something

99.6

a little

100

more useful with those and because we

102.72

have

103.6

all this within a single div

107.52

i'm going to sort of separate that out a

109.92

little bit

110.96

and now what i'm going to do is i'm

112.56

going to have two divs

114.96

one is basically for

118.32

the buttons and one is for the others

121.52

i'm gonna do it like this so we're gonna

122.96

go do

125.68

and we'll start with something simple

127.759

just to play with it see how it looks

130.56

which is not an uncommon thing to do

133.599

and i'm going to use let me do this so

136.239

there's my two buttons

138.879

and i do a break because i'll make sure

142.319

these are on different lines

144.8

because that is and then i'm going to

147.2

use

148.239

um a class from bootstrap

153.12

and the first part i'm going to do is

155.68

going to be

156.72

md let's do 8.

160.56

and i believe we talked about this

161.84

before this is

163.84

within bootstrap we've got essentially

165.92

12

167.28

sections that it splits the screen into

170.4

and so we're gonna take the first eight

172.16

first two thirds and display most of our

174

cards

174.48

in the buttons gonna be on the second

175.92

two thirds so if we just look at that

180.48

we're gonna see where it's not showing

181.76

oh because it's not within a single row

184.08

because we have our

186.33

[Music]

188.239

because we have our line breaks there so

190.64

what we want to do is actually tasks is

192.56

also going to be a row

193.84

i think that will take care of our

196.84

problem

198.4

it may not

202.4

so he's going to be a row he says that

204.319

that should be there

206.879

did i save it

213.68

let's check that real quick make sure

215.36

that we got it i may not have

220.879

so it's not picking that up right oh it

222.56

may not be picking up

227.44

everything correctly it's probably not

229.519

picking did i not get my

231.519

bootstrap in there i may not have

232.959

bootstraps so let's take a look at that

234.239

real quick

235.68

so we look here and so we're going to

238

play with this so

239.28

okay so that's a row

244.799

let's do it within that because i think

246.4

we're if we look at this guy

248.64

so let's change this a little bit

252.239

since that whole thing is going to be a

254

task we're going to create one more

256.16

here

259.199

to keep the those two essentially a row

267.919

come down here

275.12

i think that's right let's probably

276.88

balance this out let's see how it looks

279.6

there we go so now we've got our

281.12

two-thirds and we'll see as we collapse

283.04

this

283.6

whoops let me oh yeah that's right that

286.96

is collapsing

287.6

it just takes a while because of that

289.44

but we'll see as we collapse here

291.759

um it does a couple things that are sort

293.52

of ugly but we do eventually get to see

295.199

where our buttons just get forced to the

296.72

bottom

297.84

which is essentially what we want so

299.36

let's go back to this because we're

300.639

going to keep it at this point mostly

302.639

now let's add a little more information

304.32

here because we've just got a name a due

306.24

date and a status

308.24

and a time and what we really want

311.28

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

312.72

start splitting this up a little bit so

314

we're going to do this in

315.199

twos

321.6

and we're going to do another one here

328.8

and first we're gonna have the name and

331.919

then the second one

336.08

we're gonna have the due date

339.12

and then we're gonna take this guy

342.32

and put him here we're gonna do the same

344.08

break we can i could play around with

345.759

this all differently but that's just a

346.96

nice quick and easy way to do it

352.639

and then i'm going to do so that's four

355.84

four and let's start

358.96

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

360.4

one more two because we're gonna play

362.08

around this little bit

364

and here we talk about the time frame

369.36

and this is going to be task dot i

371.759

believe we called it parent

374.16

no test.timeframe and so let's take a

376.72

look at what that

378

looks like so now if we

381.28

access this remember this is actually a

383.28

class this could be in order to see how

384.72

that comes out

386.08

and is there anything else we want to do

387.68

for our task

389.52

let's see status completion date uh

392.24

that's good enough

397.6

so actually i think we just do it like

398.96

this probably changes around but now

401.84

what we've got

403.759

is so now we're seeing we've got our

405.28

time frame and see how this

406.88

wraps because it's in that space of two

409.199

we're also wrapping our name

411.36

due date time spent so let's move this

413.28

around a little bit

415.919

and let's take this last one we're gonna

418.319

split that to three

420.08

i'm gonna take our name and status well

423.12

let's see

424.08

take due date because i think that

425.36

wrapped

427.36

so we take a look at due date oh that's

429.28

okay so we're going to keep due date and

430.56

time spent where they were

432.88

gives us seven to play with so let's

435.12

open up the time frame one

437.199

and the name by two and let's see how

439.44

that looks

443.84

so now we've got our time frames

446.96

uh interesting thing is this one's

448.639

coming over a little bit

450

that may not have the right div on it

452.24

but we're seeing that the name is status

454.4

and then due date time spent so yeah

456.319

here

457.759

oh it's because time spent is getting

460.479

pushed over i believe so let's take a

462

look at that

463.36

actually let's take a look at it here

466.879

and we'll see that he is a four

472.56

he is a three if we go to the one above

480.8

he's a three

485.52

four seven five twelve so what did we do

488

here we did so oh

489.84

because it's an equals three so that's

491.36

why it's not looking right we got a typo

493.199

so if we do this

497.759

and we're going to do that let's change

499.039

this button here

501.68

this style is

505.039

class is equal to button so let's call

507.44

it something different

509.68

uh class equal to button info let's do a

512.959

button let's do task button let's do

516.719

button btn

518.839

task

523.519

and we're going to change this in our

526.04

css which is

527.839

somewhere up here it's going to create a

530.08

btn task

532.08

i don't think we have a btn yet oh we do

534.08

we have a default

539.2

we're going to call this task

543.12

and we're going to take it and let's

544.8

change this a little bit so let's take

546.48

this guy

550.08

and we're gonna change here the button

552.48

info

553.68

um i like the color we'll keep the color

556.24

let's change the background color

559.2

let's go to something

564

and let's see we can do this

570

start playing around with color this way

571.68

or we can just pick one

573.519

so let's pick

577.12

um let's change this a little bit so

578.8

let's go we're going to go to our

579.68

background color

582.24

and we're going to make it let's see ddd

586.56

that's very light so let's go a little

589.6

darker let's go like aaa

593.76

and then let's change our border color

595.76

i'm sorry not our border color we can

597.279

leave that that'll be fine

599.44

we'll change our color from this fff

602.959

to this guy

607.76

which is this

614.48

so we take him and go here

620.399

change our border color to that whoops

623.92

that's not the one i want i want to

625.04

change this color

628.8

to that and let's

632.959

change that color to

636.56

something darker like that and then

642.16

we're going to take this and we're going

643.68

to add whoops

646.64

we're going to do some a little styling

648.8

with them so we're going to do

650.88

a uh let's do

657.2

see based on this let's do a

661.68

let me do padding bottom

666.8

and let's make this

670.72

3 pixels

675.92

and spacing bottom

685.68

actually it's called what which we want

690.24

uh

693.68

margin bottom uh let's do margin bottom

697.839

let's make him like five pixels

700.88

so now we're spreading these out a

702.32

little bit

704.56

five's probably too much so let's drop

706.079

that to about three

708.64

and we're going to change the width

718.16

come here

721.839

well let's sit this way i'm going to

723.6

take all of that i'm going to steal that

725.279

and that's going to become

726.399

my button task

735.12

and i'm going to set a width of

739.2

i don't know what i want my width to be

740.48

let's set it to 50 pixels and see what

741.92

it looks like

743.2

so if i do that and then reset

749.279

it did not reload my static so i'm going

751.839

to come in here

757.04

and reload it and let's see how it looks

758.8

here okay did i not get my

761.279

oh wait

764.88

let's take a look at that

768.48

if i look at that button

772.88

i go up here

779.839

may not have his stuff right so let's

781.68

take a look real quick here

784.639

uh he's a bt in task

789.2

and if i go to my task list whoops

794.32

he's a btn task class

801.279

so he's getting what he needs

805.92

but i do want to change him to

810.16

i go to 70

815.839

and i want font size

819.44

to be

822.48

let's go to smaller like that

826.16

so let's take those two

832.8

and put those here i believe there we go

842.079

got a warning in here somewhere

857.6

should be text line

862.56

see if we get any others oh we do menu

864.48

item

867.04

that's fine okay so save it

874.56

and we probably have to reload that

877.839

window

882.079

for some reason it's not reloading our

886

css though

889.36

we're going to leave that for now i'm

890.32

going to come back to it mostly because

892.16

we're running out of time so

894.88

first thing we want to do is move some

896.48

of this stuff around

898

see where our time frames are

901.279

so we can see those and get into those

902.8

we can do our edits

904.399

and dive into those we're going to clean

907.279

up a couple of these other things like

908.8

here

909.199

we've got a task list do a little more

911.6

clean up next time around and start

913.279

walking through this application and

914.639

just see what additional changes we can

916.88

make

917.839

so that'll do it for now have yourself a

920.48

great day

921.519

and we will talk to you next time

939.6

you