Detailed Notes
Our tutorials move into handling master detail relationships on Django pages..
You can view source for today and all prior days by reviewing the tag Day 31 at this GitHub: https://github.com/robbroadhead/develpreneur-pythontutorial
Transcript Text
three two one well hello and welcome back we are continuing our python django uh creating some road maps and time frames and one of the things we're gonna do now is we're gonna go in and add a little a couple nice little features here that we missed this create roadmap we do not have that uh on our task lists i'm sorry our task task list um to do doesn't even exist anymore so i'll have to clean that one up and also for our time frames it's just empty so let's move that over so we're going to do a create uh let's see so we're going to steal that basically from the road map list oh there we go road map list so here we've just got a button up at the top and uh it's going to here's create road map and it's just going to go to the page road map well we are going to go to our uh time frame list we're going to put that here except for this page is going to be time frame so we're going to start tying some of this stuff together for us a little bit uh let's see to do i'm gonna go check that to do because that's now bothering me a little bit in the back of my mind so let's see so create a time frame whoops so give us a button for that and let's go ahead and take the same thing and do it for our task list so we get some consistency here so it's going to go to task and create task let's look at our uh let's see go back to that where was our oh here's our page when we did to do so task list let's just do a quick check so task look what the task list works roadmap does in home um go back here and i'm going to want a time frame list which i'm probably going to get rid of to do so to do lookup status matching query does not oh because we probably don't have anything with our which we'll have to fix this model does not exist because we don't have a short name here when we do this we actually went in and we used to blank those out somehow so okay so if we go look at uh that would be in our views let's go find that real quick uh so we had that was in test so our short name is going to be edit task let's see where is that at there it is okay so active tasks so cancel it's going to be cncl and complete i think is comp let's check that real quick and see if that is if that is indeed the case we may not even have those uh what do we call this we call this admin login and so if we look at uh lookup statuses we had cncl and comp cncl comp so now if we save those we probably will be able to get although it's probably still going to be an empty list oh no it's not so we do have a whole bunch so we have a whole bunch of active tasks okay so we've got our to-do list working let's add to our um i put our time frames up in our model or in our navigation so we've got road map we do time frame so allow us to get to that uh that was just gonna be tfs and we'll actually call this road map uh road maps time frames task list to do that'll work so we'll keep that for now let me go in here so now up time frames is a bit big so let's open that guy up just a little bit we'll just do it this way it's not the greatest way to do it but now there we go so time frames just gets a bigger button so we come in with road maps and we have one that's called annual for 2021 we haven't spent any time on it or anything we haven't got a completed date so now what we want to do is add uh create a time frame now with this edit roadmap um we could do our create time frame from here so you would sort of you get a workflow essentially and you could actually even remove time frames from this so you would go to a road map you create one and you'd have like a maybe a button that says create time frames and then here you would probably have somewhere listed the time frames that are related to that roadmap we're limited on data because we haven't done much with this but we are going to come back around to that so for now we're going to keep it sort of manual so time frames let's go look at that create time frame um we did oh because we said it was time frame instead of tf so i can't go that way i can go this way and when i did the time frame list that actually has to be go to page tf so if i save it go back a page i'm going to reset it create time frame uh so now so i can't i can only concatenate string not date time date time and so it's running into this on there's a date time related to my time frame and so if i go look uh let's see there's my three if i go to my form itself did i do something weird with that it may not like the that may be the problem is it may not like the fact that i called it a time frame nope uh so this is internal line set let's take a look at that uh we're gonna go internal line seven interesting uh oh i'm sorry it probably thinks that that so if i go to tfs in my urls let's make sure this lists time frames and if i go to list time frames am i doing something weird here uh let's see objects all order by name all time frames time frames time frame list what's it complaining about so in time frame edit there's something that it doesn't like so let's go look at time frame edit oh i bet i did something weird here um form as table let's see is that the right form so did i set the form right for my time frame edit uh edit time frame data form so form is equal to the timeframe form instance equal to the data data is coming from time frame objects request get id oh you know what that's not it because it should be in create time frame which is what i just pulled up not edit time frame so let's take a look at that real quick did i do the right one did i do a tf i think i did oh this is in so road map oh sorry so time frame list it's going to go to page tf tf is create time frame if we go to create time frame ah we don't need an owner let's see is that our only issue we now get something different it is trying to hit in models 20 oh shoot i bet i changed something here that i don't need to yes so road map does not need oh i have a start date i don't need to string that i'm sorry that's my problem see if i do this real quick let's see if that'll work if not we'll just yank that out there we go so we now can create a time frame and this will be uh let's see our period is going to be annual so these would be our annual goal so let's just call this um overall annual goal tasks well say goals so it's name of our time frame and it's going to tie to and see that we created our annual goals i think we've seen this before but now we can see that this lookup's going to find one for us it's going to give us the opportunity of whatever matches that relationship that foreign key relation and so we're going to tie this to annual goals and so now record saved and if we go to time frames and list we'll be able to see our overall annual goals we'll be able to edit and we can go to that now what we can do is we can go to our task list and we're actually going to get some of this stuff cleaned up a little bit and let's and we're just gonna we'll start with the existing tasks we'll just edit these guys and so let's give ourselves something here now see that we have the time frame here now because we added it so we can do this to overall annual goals and we're going to keep this we're going to start creating some of these because we're going to be working on this so let's say we're going to have professional improvement and we'll leave it here and keep very simple right now so we've got professional improvement and we're going to do which should show up somewhere in there ah there we go professional improvement uh let's let's see we'll get our set one two three so we're going to just complete these and get these off of that list because i think uh probably not because this is on the to-do yeah shoot so well we'll take care of those later so professional development and this is going to be uh personal improvement roof mint and again we're going to tie it to our overall annual goals and we'll keep it new blah blah blah good got all that going and then um we'll do one more which will be uh help and we'll call that health improvement so these are the three things i'm going to three areas i'm going to work on for my annual stuff new boom boom boom so now if i go to a road map and i look at my annual goals for 2021 and edit it uh oh it's not going to show me anything because i don't have i don't have them listed but if i go to a time frame over all annual goals then i can edit that but what i don't have is what i want is the tasks related to a time frame so let's go with uh we're going to do this within the edit time frame because within that i'm going to have i want to list my tasks so let's add that real quick so time frame edit is going to change and he's going to get essentially the task list so i can say and i'm going to sort of play around with it a little bit because i'm going to take the same thing now and i'm going to flip over to my time frame edit here's the end of my form and let's see so the title is in h1 so down here i'm going to do see we'll do period goals or let's say goals for the period we're going to leave the create task that's going to allow us to jump over to that we're going to do tests blah blah blah blah blah we're going to do essentially the same thing no tasks will be no tasks assigned this period we'll call it this time period yeah do this okay so now all we've got to do is we need to get our list of tasks and if we go over to our views so this is going to be on our edit so let's go back to where we did list tasks let's delete test list tasks here we go so let's just sort of steal that real quick and with our edit i come in here and now what we want to do so we're going to keep tasks we don't need to title we don't need the parameters nor the return so all we need to do is get the tasks and then we're going to assign that out here to tasks and it's going to be tasks and we're going to filter and this is going to be where uh time frame whoops equals uh our time frame which is our data because this is a time frame object so we should be able to directly do that and i think we'll keep our order by so let's see how that happens let's see how that looks so now if we go to edit time frame boom we've got goals for period we can create a task and we can see the tasks related to it there we go we have added some lists we can do the same thing and let's go do that real quick for our roadmap so we're essentially going to do the same thing with our roadmap so where we do list time frames let's see there we go and we're going to come up here to roadmap where i just saw edit roadmap and so now uh we'll give him time frames because i think that's what we called them before and here instead of all we're going to do filter and this is going to be where i think we call it roadmap equals data did we call it roadmap uh yes we did so we could save that save that and now we have to add it to our roadmap view so we're going to take our time frame list and we'll keep the track actually we're going to do all this because we're just going to change a few of these things around if we go to our road map edit and come down here this is going to be an h2 and this is gonna be uh we'll call it time frames create one if time frames blah blah blah blah blah blah blah and i think we're ready to go and so now if we look at road map and we edit we can see it and then we can come to our edit here is oh now because of our way we did this link uh go page is actually going to be i'll have to change that a little bit which we put that in some javascript here we go it's in our where did we do that i think we added it there that's a good question where did we put go page oh it's probably in our header maybe if we go here yes go page window like location equals page and oh we need to do we're gonna have to add a slash in front of these so if we go to roadmap list he's gonna have to go to roadmap uh if we go to roadmap edit go page he's gonna have to be there and let's see if we go to task list i think we're good there let's do it anyways and go to slash task and time frame edit slash task and complete task oh here we go that's a go page okay so i think now we're good so if we go back here we do an r we refresh now we're going to edit so we can see our tasks and we can edit a task so we've added a nice little bit of uh navigation now we can actually start building out uh period goals but one of the things we don't have we're gonna work on next time is we have these uh we have these time frames but we don't have a way to sort of tighten them up to connect them to each other so for example we have annual goals we're going to be able to create which we'll do next is we'll have first quarter and this will be a quarterly time frame and it's going to be tied to this road map but we don't have if we look at it we don't have a way to tie these two together to show that first quarter comes under overall annual goals and we will tackle that in our next session so as always this will be day 31 if you're looking for tags for the code and as always go out there have yourself a great day and we will talk to you next time
Transcript Segments
three two one
well hello and welcome back we are
continuing our python django
uh creating some road maps and time
frames
and one of the things we're gonna do now
is we're gonna go in and
add a little a couple nice little
features here that we missed
this create roadmap we do not have that
uh on our task lists i'm sorry our task
task list um
to do doesn't even exist anymore so i'll
have to clean that one up and
also for our time frames
it's just empty so let's move that over
so we're going to do a create
uh let's see so we're going to steal
that basically from the road map list
oh there we go road map list so here
we've just got a button up at the top
and
uh it's going to here's create road map
and it's just going to go to the page
road map
well we are going to go to
our uh time frame list we're going to
put that here
except for this page is going to be time
frame
so we're going to start tying some of
this stuff together for us a little bit
uh let's see to do i'm gonna go check
that to do because that's now bothering
me a little bit in the back of my mind
so
let's see so create a time frame whoops
so give us a button for that and let's
go ahead and take the same thing
and do it for our task list
so we get some consistency here so it's
going to go to
task
and create task
let's look at our uh let's see go back
to that
where was our oh here's our page when we
did to do
so task list let's just do a quick check
so task look what the task list works
roadmap does in home um
go back here and i'm going to want a
time frame
list which i'm probably going to get rid
of to do so to do lookup
status matching query does not oh
because we probably don't have anything
with our which we'll have to fix this
model does not exist because we don't
have a short name here
when we do this we actually went in
and we used to blank those out somehow
so okay
so if we go look at uh
that would be in our views
let's go find that real quick
uh so we had that was in test
so our short name is going to be
edit task let's see where is that at
there it is okay so active tasks so
cancel it's going to be cncl
and complete i think is comp let's check
that real quick and see if that is if
that is
indeed the case we may not even have
those
uh what do we call this we call this
admin login and so if we look at
uh lookup statuses we had cncl
and comp
cncl comp so now
if we save those we probably will be
able to get although it's probably still
going to be an empty list
oh no it's not so we do have a whole
bunch so we have a whole bunch of active
tasks okay so we've got our to-do list
working let's add to
our um i put our time frames up in our
model
or in our navigation so we've got road
map
we do time frame
so allow us to get to that
uh that was just gonna be tfs and we'll
actually call this road map
uh road maps time frames
task list to do that'll work so we'll
keep that for now
let me go in here so now up time frames
is a bit
big so let's
open that guy up just a little bit we'll
just
do it this way it's not the greatest way
to do it but now
there we go so time frames just gets a
bigger button
so we come in with road maps and we have
one that's called annual for 2021
we haven't spent any time on it or
anything we haven't got a completed date
so now what we want to do is add uh
create a time frame now
with this edit roadmap um
we could do our create time frame from
here so you would sort of
you get a workflow essentially and you
could actually even remove time frames
from this so you would go to a road map
you create one and you'd have like a
maybe a button that says create
time frames and then here you would
probably have somewhere listed the time
frames that are related to that roadmap
we're limited on data because we haven't
done much with this but we are going to
come back around to that so for now
we're going to keep it sort of manual
so time frames let's go look at that
create time frame um
we did oh because we said it was time
frame instead of tf
so i can't go that way i can go this way
and when i did the time frame list
that actually has to be go to page tf
so if i save it go back a page
i'm going to reset it create time frame
uh so now so i can't
i can only concatenate string not date
time date time and so it's running into
this
on there's a date time related to my
time frame and so if i go look
uh let's see there's my three if i go to
my form itself
did i do something weird with that
it may not like the that may be the
problem is it may not like the fact that
i called it a time frame
nope uh so this is internal line set
let's take a look at that
uh we're gonna go internal line
seven
interesting uh
oh i'm sorry it probably thinks that
that
so if i go to tfs in my urls let's make
sure this
lists time frames and if i go to list
time frames am i doing something weird
here
uh let's see objects all order by name
all time frames time frames time frame
list
what's it complaining about
so in time frame edit
there's something that it doesn't like
so let's go look at time frame edit
oh i bet i did something weird here
um form as table
let's see is that the right form so did
i set the form right for my time frame
edit
uh
edit time frame data form
so form is equal to the timeframe form
instance equal to the data data is
coming from time frame objects request
get id
oh you know what that's not it
because it should be in create time
frame which is what i just pulled up
not edit time frame so let's take a look
at that real quick did i
do the right one did i do a tf
i think i did oh this is in
so road map oh sorry
so time frame list it's going to go to
page tf
tf is create time frame if we go to
create time frame
ah we don't need an owner
let's see is that our only issue
we now get something different it is
trying to hit
in models 20 oh shoot i bet i changed
something here that i don't need to yes
so road map does not need oh i have a
start date
i don't need to string that i'm sorry
that's my problem
see if i do this real quick let's see if
that'll work
if not we'll just yank that out
there we go so
we now can create a time frame and this
will be uh
let's see our period is going to be
annual so these would be our annual goal
so let's just call this um
overall annual
goal tasks well say goals
so it's name of our time frame and it's
going to tie to
and see that we created our annual goals
i think we've seen this before but now
we can see that this lookup's going to
find one for us it's going to give us
the opportunity
of whatever matches that
relationship that foreign key relation
and so we're going to tie this to annual
goals
and so now record saved
and if we go to time frames and list
we'll be able to see our overall annual
goals
we'll be able to edit and we can go to
that now
what we can do is we can go to our task
list and we're actually going to
get some of this stuff cleaned up a
little bit and
let's and we're just gonna we'll start
with the existing tasks we'll just edit
these guys
and so let's give ourselves something
here now see that we have the time frame
here
now because we added it so we can do
this to overall annual goals
and we're going to keep this we're going
to start creating some of these because
we're going to be working on this so
let's say
we're going to have professional
improvement and
we'll leave it here
and keep very simple right now so we've
got professional improvement
and we're going to do which should show
up
somewhere in there ah there we go
professional improvement
uh let's let's see we'll get our set one
two three so we're going to just
complete these
and get these off of that list because i
think
uh probably not because this is on the
to-do yeah shoot
so well we'll take care of those later
so professional development and this is
going to be
uh personal improvement
roof mint and again we're going to tie
it to our overall annual goals
and we'll keep it new blah blah blah
good got all that going
and then um we'll do one more which will
be
uh help
and we'll call that health improvement
so these are the three things i'm going
to three areas i'm going to work on for
my annual stuff
new boom boom boom so now if i go to a
road map
and i look at my annual goals for 2021
and edit it
uh oh it's not going to show me anything
because i don't have
i don't have them listed but if i go to
a time frame
over all annual goals then i can edit
that but what i don't have
is what i want is the tasks related to
a time frame so let's go
with uh we're going to do this within
the edit time frame
because within that i'm going to have
i want to list my tasks so let's add
that real quick
so time frame edit is going to change
and he's going to get
essentially the task list so i
can say and i'm going to sort of play
around with it a little bit
because i'm going to take the same thing
now and i'm going to flip over to my
time frame edit
here's the end of my form
and let's see so the title is in h1 so
down here i'm going to do
see we'll do period goals
or let's say goals for the period
we're going to leave the create task
that's going to allow us to jump over to
that we're going to do tests blah blah
blah blah blah we're going to do
essentially the same thing
no tasks will be no tasks assigned
this period
we'll call it this time period
yeah do this okay so now
all we've got to do is we need to get
our list of tasks
and if we go over to our views so this
is going to be on our
edit so let's go back to where we did
list tasks
let's delete test
list tasks here we go so let's just sort
of steal that real quick
and with our edit i come in here
and now what we want to do so we're
going to keep tasks we don't need to
title we don't need the
parameters nor the return so all we need
to do is get the tasks
and then we're going to assign that out
here
to tasks and it's going to be
tasks
and we're going to filter
and this is going to be where uh time
frame
whoops
equals uh our time frame which is
our data
because this is a time frame object so
we should be able to directly do that
and i think we'll keep our order by so
let's see how that happens let's see how
that looks
so now if we go to edit time frame
boom we've got goals for period we can
create a task and we can see
the tasks related to it
there we go we have added some lists we
can do the same thing
and let's go do that real quick for our
roadmap so we're essentially going to do
the same thing
with our roadmap so where we do
list time frames
let's see there we go and we're going to
come up here to
roadmap where i just saw edit
roadmap and so now
uh we'll give him time frames because i
think that's what we called them before
and here
instead of all we're going to do filter
and this is going to be where i think we
call it roadmap
equals data did we call it roadmap
uh yes we did so we could save that
save that and now we have to add it to
our roadmap view
so we're going to take our time frame
list
and we'll keep the track actually we're
going to do all this because we're just
going to change a few of these things
around
if we go to our road map edit
and come down here
this is going to be an h2
and this is gonna be
uh we'll call it time frames
create one if time frames blah blah blah
blah blah blah blah
and i think we're ready to go and so now
if we look at road map
and we edit we can see it and then we
can come to our
edit here is oh
now because of our way we did this link
uh go page is
actually going to be i'll
have to change that a little bit which
we put that in some javascript
here we go
it's in our where did we do that
i think we added it there that's a good
question where did we put
go page
oh it's probably in our header maybe
if we go here yes go page window like
location equals page
and oh we need to do we're gonna have to
add a slash in front of these so if we
go to roadmap list
he's gonna have to go to roadmap uh if
we go to
roadmap edit go
page he's gonna have to be there
and let's see if we go to task
list i think we're good there
let's do it anyways and go to slash task
and time frame edit slash task
and
complete task oh here we go that's a go
page
okay so i think now we're good so if we
go back here
we do an r we refresh now we're going to
edit
so we can see our tasks and we can edit
a task so we've added
a nice little bit of uh navigation now
we can actually start
building out uh period goals
but one of the things we don't have
we're gonna work on next time
is we have these uh we have these time
frames but we don't have a way to
sort of tighten them up to connect them
to each other
so for example we have annual goals
we're going to be able to create
which we'll do next is we'll have
first quarter and this will be a
quarterly
time frame and it's going to be tied to
this road map but
we don't have if we look at it
we don't have a way to tie these two
together to show that first quarter
comes under overall annual goals
and we will tackle that in our next
session
so as always this will be day 31 if
you're looking for tags for the code
and as always go out there have yourself
a great day
and we will talk to you next time