📺 Develpreneur YouTube Episode

Video + transcript

Learn Python And Django Day 47

2021-04-08 •Youtube

Detailed Notes

Part III of the creation of reports. We move to result sets based on the report and parameters form a single URL.

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

Transcript Text
[Music]
well hello and welcome back
we are hopefully wrapping up our reports
today that's our goal
uh the first thing i want to do is let's
fix the look
of the task by status i've been playing
around with a little bit so this is
a little different from the last time
you saw it
essentially if you look at tasks
or general task lists we've got some
stuff here
uh we're full line we're got a button
and this stuff doesn't really
make as much sense when we're not when
this is a report
so what we're going to do here is we're
not going to
from a report be able to jump in so this
go page on click we're not going to
worry about that anymore
which means because this isn't an
interactive report we don't need to
worry about the ids at all
and actually what we want to do for here
is we're going to turn this
into a table because it's going to be a
little easier for us to deal with it
that way
so what we're going to do is we're going
to come swing through here blah blah
blah
there we go so there's our table
first thing we'll do is we're going to
create some headers so we're going to
have a header row
that's going to be let's call
it uh it's gonna be the time frame
we're also gonna have
and this is gonna make stuff just a
little bit easier for us to deal with so
we're gonna do a time frame
a name
a due date
ah let's do status let's do status and
then due date
status
we'll go ahead and do time spent
and then due date
so now we can take all of these and
we're going to shrink these down a
little bit
so then all we need to do is for each
one we're going to create a row
get rid of our divs
and this is going to be a detail so td
now we could do some more interesting
things with these but we're not going to
at this point
we may come back and sort of like some
advanced stuff
and look at some ways to play around
with tables and why this may make a lot
of sense for us
particularly from reports and just
sort of a spoiler alert what we can do
is we're going to be able to do things
like use a jquery
table pager that basically makes it real
easy to
for stuff to look good and have paging
built into our reports without us having
to do much work at all
but that works with a
whoops that works with a table as
opposed to
divs so we're gonna keep that in mind it
also requires us to have like a
table head or a table body or t-head
t-body section with
which we're not gonna do right now but
we will talk about that at some point
just something if you want to jump ahead
at some point and clean this up
uh so okay so let's see so we've got uh
due date but no
so we have time frame name status
spent and due date so that's our here
we'll just
clean it up a little bit
do it like that so there's our rows and
let's make our table
uh we're going to make it not a hundred
percent
and let's just look at that right now we
may do some more cleanup but for now
oops that's task i want to go to report
if i wanted to test by status complete
and what we're going to see here
is something that's a lot you know a lot
more report
like then we can add some more stuff we
can do some borders and some spacing but
for right now
we're just going to keep it like this
now
before we had by status we had by
timeline
so we could look at our first quarter
we've got some stuff there
then roadmap is basically the same thing
but roadmap what we want to do
is pick a roadmap so let's go back and
do that
handle that one
in which case so here where actually the
perimeter is actually a roadmap
so what we need to do is we need to find
all the tasks
where the rope for a certain roadmap
now we actually have that query
let's see where do we put that i believe
this is
it
ah that's not it do we have
edit roadmap i think we had tasks
within that we may not have oh no
because within that
we had the time frames
so well let's play with this
a little bit
so this is going to be a bit of a
challenge where did we put that it's
going to be up here
so what we want is we want all of the
tasks
oops that's not it we want all of the
tasks
where we have a specific roadmap
and so this is going to be
a bit of a challenge and what we want to
do is
let's start by this is what we want to
do is get our
see we'll do it in it we'll do it a
single let's do it in a single query
so this is just going to be tasks
and it's going to be a raw
and we do want our id we know we're
going to pass that
in and what we want to do here
is we're going to task we want to do
t.star
so we know we want that from
dp project tasks i believe it's what we
call it
it's just task
and let's actually oh that's running
let's go over here
let's just do it this way i'm gonna
cheat
oops
oh it won't let me do that okay so i
gotta go back and actually have to
remember what my password was
and that's in my settings wherever i put
my settings
so let's see my user is root
and that's my password so
that's you dash p
so now let's show databases because i
forget what it's called
it is dp project
and now show tables so
we can do a select star from dp project
underscore task
oh
so now we've got that so we've got all
of our tasks
now but so let's start with
that so if we do that
but now what we need to do and that's
we're going to call it t
but now we're going to have to join so
we can do
an inner join on
dp project time frame
so we're going to call him tf
and we're going to do it on the time
frame
on the task dot time frame
id
and if we look back here
we can see where we're going to do it
with this time frame
id
so where so we want to get all the time
frames where the time frame
id the id for that equals our time frame
id so this is going to pull in all of
our project
all of our time frames and now here
and then we wanted where the time frame
dot parent id
which i think is what we call the road
map so we've got our time for oh road
map
and so now we have to jump up to where
the road map
id equals
our task
and so here let's look at this
and let's give ourselves a road map id
of one
and see if that brings us something back
let's do that so if we do it where
roadmap id equals one
then we do get tasks back based on that
and so this is going to be and this is
uh
where do we go back to our view so
walking through this real quick
we get everything from our task but now
what we're going to do
is we're going to with each task we're
going to look into the time frame
and look at its roadmap id that's where
we get this tf
that id and then we want the roadmap id
equal to the value that we send across
and so in doing now if we go to roadmap
and we look at all that in our personal
goals annual goals 2022
we're gonna see we don't have any but if
we look at 2021
we see that we do have some so if we go
to roadmap 2022
it doesn't have any children it doesn't
have any tasks
so we can see that one actually pretty
quickly now here annual goals
we've got
uh professional goals doesn't have any
children and personal goals does
and has some tasks here
if we look down here now this is because
uh if you look
the time frames do not roll up so we
just looked at the top level
so we do have to make a change here so
what we want to do
is we want to
change this around a little bit is we
need to look where the road map is that
but if we look
at our road maps
we're gonna see if we can remember
uh let's see from time frames i'm sorry
we are going to be able to come in here
and we see that some
okay so those all have a road map of oh
well they should be good so they should
have tasks
uh so we probably are okay so if we look
at
and we need to figure out what we're
missing here
oh probably because some
let's go back and look at our tasks if
we look at our
tasks
and we have our time frame id sum
did not have we have some of these that
we did not tie
actually to a time frame which is
interesting enough
so if we look at these
so if we look at like test one two three
four five six
we're not actually going to see those
anywhere
i don't think
so we look in here we've got a whole
bunch of tasks but because we didn't tie
them to a time frame
then we're not going to see them so even
though we had a bunch we don't have
anything
listed out so that's why we're seeing a
little bit different but if we look to
all tasks whoop sorry if we go back here
and look at our task list so we see here
see time frame no no no no no no
those should not technically should not
exist
but even if they do they're not tied to
a roadmap so we are
good now let's go back to our report
and uh if we look at my status let's see
here's all of our new
uh i think what i'm going to do we could
we could do a couple different things
here but i think right now what i want
to do
is wrap this episode up
because what we've got next is basically
some cleanup kinds of things
and i think the next one i want to do is
actually do more of a walk through
because what we're going to do is we're
going to talk about uat basically
user acceptance testing and since we
we're going to say this is quote done
sort of
we've got our all of our basics in we're
going to do a walk through and we're
actually going to talk about some of the
things that we need to fix now some of
these have been done along the way
but also they've done been done without
a thought towards
um other we haven't gone through and
done like a
you know a sweeping test to see if we
broke stuff or not
and so we're gonna do that next time
around and we're gonna we're getting
pretty close we're gonna
actually get to the point where we can
wrap this thing up in the next couple
episodes
but until then go out there and have
yourself a great day a great week
and we will talk to you next time
you
Transcript Segments
0.46

[Music]

26.16

well hello and welcome back

27.84

we are hopefully wrapping up our reports

30.16

today that's our goal

31.679

uh the first thing i want to do is let's

34.079

fix the look

35.12

of the task by status i've been playing

38.16

around with a little bit so this is

39.68

a little different from the last time

41.28

you saw it

42.84

essentially if you look at tasks

46.32

or general task lists we've got some

48.719

stuff here

49.76

uh we're full line we're got a button

52.719

and this stuff doesn't really

54.64

make as much sense when we're not when

57.039

this is a report

58.399

so what we're going to do here is we're

60.48

not going to

62

from a report be able to jump in so this

65.84

go page on click we're not going to

67.68

worry about that anymore

70.159

which means because this isn't an

72.159

interactive report we don't need to

73.52

worry about the ids at all

75.439

and actually what we want to do for here

78.24

is we're going to turn this

79.52

into a table because it's going to be a

82.32

little easier for us to deal with it

84.159

that way

85.36

so what we're going to do is we're going

86.24

to come swing through here blah blah

88.32

blah

88.96

there we go so there's our table

92.479

first thing we'll do is we're going to

93.52

create some headers so we're going to

95.52

have a header row

96.96

that's going to be let's call

100.4

it uh it's gonna be the time frame

105.2

we're also gonna have

109.6

and this is gonna make stuff just a

111.2

little bit easier for us to deal with so

113.04

we're gonna do a time frame

115.92

a name

118.96

a due date

124.399

ah let's do status let's do status and

126.799

then due date

129.119

status

132.72

we'll go ahead and do time spent

137.84

and then due date

142.16

so now we can take all of these and

145.04

we're going to shrink these down a

146.48

little bit

149.68

so then all we need to do is for each

151.28

one we're going to create a row

156.48

get rid of our divs

161.68

and this is going to be a detail so td

167.76

now we could do some more interesting

169.599

things with these but we're not going to

171.04

at this point

173.76

we may come back and sort of like some

175.76

advanced stuff

177.68

and look at some ways to play around

179.12

with tables and why this may make a lot

181.599

of sense for us

183.519

particularly from reports and just

186.8

sort of a spoiler alert what we can do

190.64

is we're going to be able to do things

192.48

like use a jquery

194.64

table pager that basically makes it real

198.48

easy to

199.44

for stuff to look good and have paging

201.68

built into our reports without us having

203.36

to do much work at all

205.36

but that works with a

208.72

whoops that works with a table as

211.84

opposed to

213.36

divs so we're gonna keep that in mind it

216.4

also requires us to have like a

217.92

table head or a table body or t-head

220.72

t-body section with

222.239

which we're not gonna do right now but

224

we will talk about that at some point

227.12

just something if you want to jump ahead

228.799

at some point and clean this up

231.44

uh so okay so let's see so we've got uh

234.48

due date but no

236.879

so we have time frame name status

240.72

spent and due date so that's our here

243.68

we'll just

244.4

clean it up a little bit

249.36

do it like that so there's our rows and

251.68

let's make our table

256.32

uh we're going to make it not a hundred

257.919

percent

260.56

and let's just look at that right now we

262.8

may do some more cleanup but for now

264.32

oops that's task i want to go to report

267.04

if i wanted to test by status complete

269.6

and what we're going to see here

271.04

is something that's a lot you know a lot

273.36

more report

274.479

like then we can add some more stuff we

276.479

can do some borders and some spacing but

278.08

for right now

278.72

we're just going to keep it like this

281.44

now

282.16

before we had by status we had by

284.72

timeline

285.6

so we could look at our first quarter

288.32

we've got some stuff there

290

then roadmap is basically the same thing

292.479

but roadmap what we want to do

294.24

is pick a roadmap so let's go back and

296.88

do that

297.36

handle that one

300.56

in which case so here where actually the

303.6

perimeter is actually a roadmap

305.919

so what we need to do is we need to find

308.24

all the tasks

310.479

where the rope for a certain roadmap

315.039

now we actually have that query

318.88

let's see where do we put that i believe

324.72

this is

325.28

it

330

ah that's not it do we have

334.24

edit roadmap i think we had tasks

339.36

within that we may not have oh no

342

because within that

343.68

we had the time frames

347.759

so well let's play with this

351.039

a little bit

355.28

so this is going to be a bit of a

357.12

challenge where did we put that it's

358.88

going to be up here

361.36

so what we want is we want all of the

363.039

tasks

364.72

oops that's not it we want all of the

366.72

tasks

367.759

where we have a specific roadmap

371.84

and so this is going to be

375.12

a bit of a challenge and what we want to

377.44

do is

378.4

let's start by this is what we want to

380.08

do is get our

382.4

see we'll do it in it we'll do it a

383.84

single let's do it in a single query

388.56

so this is just going to be tasks

396.4

and it's going to be a raw

401.44

and we do want our id we know we're

404

going to pass that

404.8

in and what we want to do here

409.599

is we're going to task we want to do

412.8

t.star

416.56

so we know we want that from

421.12

dp project tasks i believe it's what we

423.68

call it

426.56

it's just task

430.24

and let's actually oh that's running

432.639

let's go over here

437.199

let's just do it this way i'm gonna

438.4

cheat

448.84

oops

450.24

oh it won't let me do that okay so i

451.919

gotta go back and actually have to

452.96

remember what my password was

458.96

and that's in my settings wherever i put

461.12

my settings

466.72

so let's see my user is root

470.96

and that's my password so

475.28

that's you dash p

482.56

so now let's show databases because i

484.96

forget what it's called

487.759

it is dp project

492.8

and now show tables so

497.28

we can do a select star from dp project

501.759

underscore task

507.44

oh

512.64

so now we've got that so we've got all

514

of our tasks

516.88

now but so let's start with

520

that so if we do that

523.44

but now what we need to do and that's

525.44

we're going to call it t

527.2

but now we're going to have to join so

530

we can do

530.64

an inner join on

535.04

dp project time frame

538.24

so we're going to call him tf

541.279

and we're going to do it on the time

543.04

frame

545.44

on the task dot time frame

552.64

id

555.68

and if we look back here

558.8

we can see where we're going to do it

561.04

with this time frame

562.08

id

566.32

so where so we want to get all the time

568.399

frames where the time frame

570.399

id the id for that equals our time frame

574.839

id so this is going to pull in all of

577.279

our project

578

all of our time frames and now here

583.2

and then we wanted where the time frame

585.36

dot parent id

586.8

which i think is what we call the road

588.56

map so we've got our time for oh road

591.04

map

594.399

and so now we have to jump up to where

596

the road map

598

id equals

603.68

our task

607.76

and so here let's look at this

610.959

and let's give ourselves a road map id

613.68

of one

614.56

and see if that brings us something back

619.36

let's do that so if we do it where

622.88

roadmap id equals one

624.72

then we do get tasks back based on that

628.16

and so this is going to be and this is

630.959

uh

632

where do we go back to our view so

634

walking through this real quick

635.36

we get everything from our task but now

638.32

what we're going to do

639.36

is we're going to with each task we're

641.68

going to look into the time frame

643.92

and look at its roadmap id that's where

646.88

we get this tf

648.079

that id and then we want the roadmap id

651.519

equal to the value that we send across

655.12

and so in doing now if we go to roadmap

659.76

and we look at all that in our personal

661.519

goals annual goals 2022

663.839

we're gonna see we don't have any but if

665.36

we look at 2021

669.36

we see that we do have some so if we go

672.88

to roadmap 2022

674.56

it doesn't have any children it doesn't

676.32

have any tasks

677.92

so we can see that one actually pretty

679.6

quickly now here annual goals

683.6

we've got

686.959

uh professional goals doesn't have any

688.48

children and personal goals does

691.36

and has some tasks here

694.8

if we look down here now this is because

697.519

uh if you look

698.48

the time frames do not roll up so we

701.68

just looked at the top level

703.68

so we do have to make a change here so

706.72

what we want to do

707.76

is we want to

711.519

change this around a little bit is we

712.72

need to look where the road map is that

715.6

but if we look

716.48

at our road maps

720.8

we're gonna see if we can remember

724

uh let's see from time frames i'm sorry

732.32

we are going to be able to come in here

734.72

and we see that some

736.24

okay so those all have a road map of oh

738.88

well they should be good so they should

740.32

have tasks

744.24

uh so we probably are okay so if we look

746.32

at

748.56

and we need to figure out what we're

750.079

missing here

755.76

oh probably because some

759.04

let's go back and look at our tasks if

760.72

we look at our

763.36

tasks

767.68

and we have our time frame id sum

771.68

did not have we have some of these that

774.88

we did not tie

775.839

actually to a time frame which is

778.079

interesting enough

780.32

so if we look at these

784.16

so if we look at like test one two three

786.079

four five six

787.6

we're not actually going to see those

790

anywhere

791.44

i don't think

794.639

so we look in here we've got a whole

795.92

bunch of tasks but because we didn't tie

797.519

them to a time frame

799.279

then we're not going to see them so even

801.04

though we had a bunch we don't have

802.56

anything

803.04

listed out so that's why we're seeing a

806.48

little bit different but if we look to

808

all tasks whoop sorry if we go back here

812.32

and look at our task list so we see here

814.16

see time frame no no no no no no

815.92

those should not technically should not

819.199

exist

820

but even if they do they're not tied to

821.839

a roadmap so we are

824

good now let's go back to our report

829.36

and uh if we look at my status let's see

832.399

here's all of our new

834.8

uh i think what i'm going to do we could

837.6

we could do a couple different things

838.8

here but i think right now what i want

840.079

to do

840.639

is wrap this episode up

844

because what we've got next is basically

846.16

some cleanup kinds of things

848.48

and i think the next one i want to do is

850

actually do more of a walk through

851.68

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

852.639

going to talk about uat basically

855.279

user acceptance testing and since we

859.6

we're going to say this is quote done

861.76

sort of

862.72

we've got our all of our basics in we're

865.68

going to do a walk through and we're

866.8

actually going to talk about some of the

867.92

things that we need to fix now some of

869.519

these have been done along the way

871.6

but also they've done been done without

873.76

a thought towards

875.76

um other we haven't gone through and

878.32

done like a

879.519

you know a sweeping test to see if we

881.199

broke stuff or not

882.72

and so we're gonna do that next time

883.92

around and we're gonna we're getting

885.04

pretty close we're gonna

886.24

actually get to the point where we can

887.519

wrap this thing up in the next couple

889.199

episodes

890.399

but until then go out there and have

892

yourself a great day a great week

894.399

and we will talk to you next time

912.8

you