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 filtering tasks by timeframe on the fly for the view selector.
You can view source for today and all prior days by reviewing the tag Day 53 at this GitHub: https://github.com/robbroadhead/develpreneur-pythontutorial
Transcript Text
[Music] hello and welcome back we are continuing going through our uat remediation kinds of stuff and uh this episode we're just gonna start now continue working through our list didn't want to note that i got my uh style sheet updated now you're actually seeing it in this the uh from the past episode and you can see that now we've slimmed out our tasks that was one of our goals we wanted to get knocked out another thing i did not get day 51 committed so if you look at day 52 and if you're following along in github then you'll see a tag for day 52 which will have the changes from 51 and 52. now uh let's go ahead and one of the things we want to do whoops is here on our home behind the scenes this is working off of our current time frame and this is this task we want to add a filter essentially to our task list i think that's the one that we want and that looks good so that'll be the one that we're going to be focusing on next is we're going to put a little filter here now we've seen this before if we look at our reports basically if we go by timeline then we have this select timeline so we're going to steal that and we're going to put that on to over here on our to-do so if we take a look in uh that was in our reports page and what we did in that case is we actually i think built that on the fly so when we go into our views we'll do essentially the same thing so let's go to reports page ports generates tasks by time frame and then oh that was actually generating it report parameters here we go and we're going to do this one so we're going to select the timeline we're just going to steal that and we're going to put that in the to do where is oh to do is actually though if we look at to do it's active tasks so let's go to active tasks there we go and what we want to do here is we're going to add this will be before our parms and this is going to be our we're going to call this our uh selector equals that let's see options equals there oh let's just take that that's selector equals selector plus option option option farms equals and we've got this changed up so now we can send that across and we're just going to call this now we could do this actually uh probably just as easily is that we could actually uh create this in our on our page we're going to pass this in just because um and actually what we probably should end up doing is pull that ideally this would get pulled out into um some sort of a little you know a method of some sort i don't know if i want to put it in the views so we're not going to mess with it right now but ideally what you do is is take this uh this bit of code and just return the string and you could probably do that with a couple different things but i don't want to chan i don't want to change up my structure too much right now so i'm just going to keep it simple and so now i've got going into task list i'm going to send a selector and i'm sure it has an id does it have an id uh yes so this is going to be we're just going to call it uh tf let's call it uh id is just going to be tfid we'll just call that because then what we're going to end up doing is going to be able to do a little bit of work on this so let's first do that so let's add that to our selector which is in our task list which is in here somewhere there it is oh yeah task list and then let's take a look where we want to put that we probably want to put it right off of create task actually we'll put it before the count uh that's a good question uh we'll go ahead and put it yeah let's put it before the count but on the same line so we're going to do we'll do something like this so this is going to be a selector and then if we do that and run it whoops so here what we want to do is we actually want that to be so let's go take a look at that that oh that needs to be which is uh this may be a problem because the way we do it is we were actually setting the inner html based on that so we don't really want to do it that okay so we don't want to do it that way my mistake let's take that whole thing off and instead this is going to be um this is going to be options which is going to be our time frames uh let's just take that whole thing out there and then this is going to be so this is why you shouldn't do this stuff necessarily on the fly but you get to see a little bit of design thought process as part of it so now instead we're going to just pass the options in which is going to be our options for all of our time frames uh options options count okay so we should be good so instead uh where did that go that was task list yes so instead we're gonna do essentially the same thing but here we're going to do uh i'll keep that in there just because i can't and this is gonna be for opt and ops so we're going to actually be able to do almost exactly the same code we did it's going to be uh n4 so like we did here and then here instead we're just going to do option and then this is going to be the opt id and then here is going to be the opt name and then let's see oh and then we need the two we need to select so we do that oh we don't need the four anymore so we've got our uh select id equal to going to call this current whoops current time frame well i should spell select right and then we'll put the select after it and then well we'll put that tasks count and we'll do it like that so now let's take a look okay so now whoops it is not getting that right um opt-in ops opt id name so must not be getting ops for oh because i didn't save it uh it helps to save all your changes so we check it there we go so now we can set a personal we can set a time frame and so what we've got to do though is on that we're going to have to actually recall this page so what we need to do is we're going to actually steal sort of from our reports page i'm going to do the same kind of thing here um let me work it off select [Music] and i'm doing this mostly for speed purposes just from a coding point of view as well so this is going to be select time frame and then i think what we want to do here is we probably just want to that's a good question okay so let's see we want to first we got to grab our select which is current tf so current time frame we're going to get that id and then we're going to get its value which is the id and then we need to call i think what we can do is we're going to actually cheat this a little bit we're going to create a new one that'll allow us to set our time frame so we're going to do what do we call that go page i don't like that thing at all let's see go here [Music] uh here we go go page that's what we called it so what we can do is we can come in here and we are going to do this is going to be a set time frame let's call it set uh let's call it that and this is going to be id with an id and i don't need anything else and so what set time frame is going to do so let's set tf and we can just steal this so this is going to be set time frame and then it's going to do a neat little thing here because it's going to end up going back to the to-do we're going to only do this here so what we want to do is uh we'll steal that one just because of the signature whoops there we go we still set uh edit time frame so we're gonna take edit time frame basically take that we still need to be that yeah i don't know that we need too much now let's just let's copy and paste that let's do set time frame so we check for logged in i don't know if we need that where did we set um i think let's see did we just call it session tf we called it let's say p and oh because we've got it here probably it must be p let's go back to our uh was that active tasks actually let's see where do we pull it it was based off of time frame is current where's current oh it is p okay so and it's just an id so let's go here and so all we need to do here is do that request session equals id and then we're going to do a redirect to to do because we're just going to go ahead and force that thing to change now this is going to be a little bit uh hokey in a sense because oops let's run report i don't want reports page i want task list and what i'm going to do is i'm going to select time frame it's actually going to be uh on change i may be able to do a where'd that go select um oh that's going to be a good one i'm going to go do this i may want to try something a little different so let's start with this and see how it looks so if i do select time frame and then run it so now let's see if i set it to march it's not doing anything okay so let's take a look at this uh oop i don't want source i want to look at inspect console it's probably breaking select time frame not okay it's not defined so something's not right there so select oh with capital f okay got a match case and actually we want to do probably is set it to this so if i do that there we go okay yeah that's not too bad so i think we'll leave it like this what we could do is do something so we're going to only you know maybe do update button or on change like on leaving this field but let's stick that for now and what i want to do is now i need to go into my views because i need to do uh where's that edit oh i'm sorry active so now what i do need to do here is now i'm gonna need to do i'm gonna do a current [Music] and current is equal to that okay so i do have current there oh i want it to be i don't want to do that well okay so i do have a pid here so let's do that equals zero and then otherwise pid equals that and so i'm going to do it this way so what i'm going to be able to do is say now i get to go to my task list and when i'm building this thing out i'm going to do a little if here so it's going to be selected equals selected but i'm going to wrap that with a little if so i'll actually do it this way just so it's a little easier to read oh and i need that selected equals that's be a string and i'm going to do a percent and if and this is going to be uh if dot id equals pid and that probably will work did i have an end if oh i want to do end if this way so now let's take a look so immediate is going to come back oh there it is so it's going to complain because oh it's got to be equals equals uh where did i put that but that's what i need there we go so now if i go to my roadmaps and i select something different from immediate so my current time frame now is probably uh is professional goals if i go to roadmap whoop i'm sorry if i go here professional goals there we go so now i can do that i can change stuff out and i've completed my task so it took a little bit but i'm going to go ahead and make this just our sort of our focus right now is filtering our results and we'll wrap this episode up and we'll come back next time and continue working our way through our list as always go out there and have yourself a great day and we will talk to you next time you
Transcript Segments
[Music]
hello and welcome back
we are continuing going through our uat
remediation kinds of stuff
and uh this episode we're just gonna
start now continue working through our
list
didn't want to note that i got my uh
style sheet updated
now you're actually seeing it in this
the uh from the past episode
and you can see that now we've slimmed
out our tasks that was one of our goals
we wanted to get knocked out
another thing i did not get
day 51 committed so if you look at day
52 and if you're following along
in github then you'll see a tag for day
52 which will have the changes from 51
and 52. now uh let's go ahead
and one of the things we want to do
whoops is here
on our home behind the scenes this is
working off of our current time frame
and this is this task we want to add a
filter essentially to our task list
i think that's the one that we want
and that looks good so
that'll be the one that we're going to
be focusing on next is we're going to
put a little filter here
now we've seen this before if we look at
our reports
basically if we go by timeline then we
have this select timeline so we're going
to steal that and we're going to put
that on to
over here on our to-do so if we take a
look
in uh that was in our reports
page
and what we did in that case is we
actually i think built that
on the fly so when we go into our views
we'll do essentially the same thing so
let's go to
reports page
ports generates tasks by
time frame
and then oh that was actually generating
it
report parameters here we go and we're
going to do
this one so we're going to select the
timeline
we're just going to steal that and we're
going to put that in the to do
where is oh to do
is actually though
if we look at to do it's active tasks
so let's go to active tasks there we go
and what we want to do
here is we're going to add
this will be before our parms
and this is going to be our we're going
to call this our
uh selector equals that
let's see options equals there oh let's
just take
that
that's selector equals selector plus
option option option farms equals
and we've got this changed up so now we
can send that across
and we're just going to call this now we
could do this actually
uh probably just as easily is that we
could actually
uh create this in our on our page
we're going to pass this in just because
um and actually what we probably should
end up doing is pull that
ideally this would get pulled out into
um
some sort of a little you know a method
of some sort i don't know if i want to
put it in the views so we're not going
to mess with it right now
but ideally what you do is is take this
uh this bit of code and just return
the string and you could probably do
that with a couple different things but
i don't want to chan i don't want to
change up my structure too much right
now so i'm just going to keep it
simple and so now i've got
going into task list i'm going to send a
selector
and i'm sure it has an id does it have
an id uh
yes so this is going to be
we're just going to call it uh tf
let's call it
uh id is just going to be tfid we'll
just call that
because then what we're going to end up
doing
is going to be able to do a little bit
of work on this so let's first do that
so let's add that to our selector which
is in our task list
which is in here somewhere there it is
oh yeah task list and then
let's take a look where we want to put
that we probably want to put it right
off
of create task actually we'll put it
before the count
uh that's a good question uh we'll go
ahead and put it
yeah let's put it before the count but
on the same line so we're going to do
we'll do something like this so this is
going to be a selector
and then if we do that and run it
whoops
so here what we want to do is
we actually want that to be
so let's go take a look at that that oh
that needs to be
which is uh this may be a problem
because the way we do it is
we were actually setting the inner html
based on that
so we don't really want to do it that
okay so we don't want to do it that way
my mistake
let's take that whole thing off and
instead this is going to be
um this is going to be options
which is going to be our time frames
uh let's just take that whole thing out
there and then this is going to be
so this is why you shouldn't do this
stuff necessarily on the fly but you get
to see a little bit of design
thought process as part of it so now
instead we're going to just pass the
options in
which is going to be our options for all
of our time frames uh
options options count okay so we should
be good so instead
uh where did that go that was task list
yes so instead
we're gonna do essentially the same
thing but here we're going to do
uh i'll keep that in there just because
i can't
and this is gonna be
for opt and ops
so we're going to actually be able to do
almost exactly the same code we did it's
going to be
uh n4
so like we did here and then
here instead we're just going to do
option
and then this is going to be the opt id
and then here is going to be
the opt name
and then let's see oh and then we need
the two we need to select
so we do that oh we don't need the four
anymore
so we've got our uh select id
equal to going to call this current
whoops current
time frame well i should spell select
right
and then we'll put the select after it
and then well we'll put that tasks count
and we'll do it like that so now let's
take a look
okay so now whoops it is not getting
that right
um
opt-in ops opt id
name
so must not be getting ops for oh
because i didn't save it uh
it helps to save all your changes
so we check it there we go so now we can
set a personal
we can set a time frame and so what
we've got to do though
is on that we're going to have to
actually recall
this page so what we need to do
is we're going to actually steal sort of
from our reports page i'm going to do
the same kind of
thing here um let me work it off select
[Music]
and i'm doing this mostly for speed
purposes just from a coding point of
view
as well so this is going to be select
time frame
and then i think what we want to do
here is we probably just want to
that's a good question okay so let's see
we want to first we got to grab
our select which is current tf
so current time frame we're going to get
that id
and then we're going to get its value
which is the id
and then we need to call
i think what we can do is we're going to
actually cheat this a little bit we're
going to create a new one that'll allow
us to set our time frame so we're going
to do
what do we call that go page
i don't like that thing at all let's see
go here
[Music]
uh here we go go page that's what we
called it
so what we can do is we can come in here
and we are going to do
this is going to be a set time frame
let's call it set uh let's call it that
and this is going to be id
with an id and i don't need anything
else
and so what set time frame is going to
do
so let's set tf
and we can just steal this so this is
going to be
set time frame and then it's going to do
a neat little thing here because it's
going to end up going back to the to-do
we're going to only do this here
so what we want to do is
uh we'll steal that one just because of
the signature whoops there we go we
still
set uh edit time frame
so we're gonna take edit time frame
basically take that we still need to be
that
yeah i don't know that we need too much
now
let's just let's copy and paste that
let's do set
time frame so we check for logged in
i don't know if we need that where did
we set
um i think
let's see did we just call it session tf
we called it
let's say p and oh because we've got it
here probably
it must be p
let's go back to our uh was that active
tasks
actually let's see where do we pull it
it was based off of time frame is
current where's current
oh it is p okay so
and it's just an id
so let's go here and so all we need to
do
here is do that request session equals
id and then we're going to do
a redirect
to to do
because we're just going to go ahead and
force that thing
to change now this is going to be a
little bit
uh hokey in a sense because oops let's
run report i don't want reports page
i want task list
and what i'm going to do is i'm going to
select time frame it's actually going to
be
uh on change i may be able to do
a where'd that go select
um oh that's going to be a good one i'm
going to go
do this i may want to try something a
little different so let's start with
this and see how it looks so if i do
select time frame
and then run it so now let's see
if i set it to march it's not doing
anything
okay so let's take a look at this uh
oop i don't want source i want to look
at
inspect console it's probably breaking
select time frame not okay it's not
defined so something's not right there
so select
oh with capital f okay got a match case
and actually we want to do probably is
set it to this so if i do that there we
go okay
yeah that's not too bad so i think we'll
leave it like this
what we could do is do something so
we're going to only
you know maybe do update button or on
change
like on leaving this field but let's
stick that for now and what i want to do
is
now i need to go into my views because i
need to do
uh where's that edit oh i'm sorry active
so now what i do need to do here is now
i'm gonna need to do
i'm gonna do a current
[Music]
and current is equal to that okay so i
do have current
there oh i want it to be
i don't want to do that well okay so i
do have a pid here so let's do that
equals zero
and then otherwise pid equals that
and so i'm going to do it this way so
what i'm going to be able to do
is say
now i get to go to my task list and when
i'm building this thing out
i'm going to do a little if here so it's
going to be
selected equals
selected
but i'm going to wrap that with a little
if
so i'll actually do it this way just so
it's a little easier to read
oh and i need that selected equals
that's be a string
and i'm going to do a percent
and if
and this is going to be uh if dot
id equals pid
and that probably will work did i have
an end if oh i want to do end if this
way
so now let's take a look
so immediate is going to come back oh
there it is so it's going to complain
because oh it's got to be equals equals
uh where did i put that
but that's what i need there we go
so now if i go to my roadmaps and i
select something different from
immediate
so my current time frame now is probably
uh
is professional goals if i go to roadmap
whoop i'm sorry if i go here
professional goals there we go so now i
can do that i can change stuff out
and i've completed my task so it took a
little bit
but i'm going to go ahead and make this
just our sort of our focus right now is
filtering our results
and we'll wrap this episode up and we'll
come back next time and continue working
our way through our list
as always go out there and have yourself
a great day and we will talk to you
next time
you