Detailed Notes
We continue creating roadmap features with basic updates and a model change.
You can view source for today and all prior days by reviewing the tag Day 30 at this GitHub: https://github.com/robbroadhead/develpreneur-pythontutorial
Transcript Text
well hello and welcome back we are continuing our uh python and django series of sessions and uh we last time we we discussed the uh the road map we added a road map and a time frame we have the ability to list and edit road maps so we're going to start working on the time frame now one thing we're going to adjust here we've got a couple things we're going to do is uh a time frame is actually going to be tied to a roadmap it's not going to tie a task necessarily to it's it's not going to be a direct link there because we'll have a single time frame for example annual that would have multiple tasks related to it and this is uh a little bit to just help us in how we're going to do this from a user experience point of view and that being that we're going to come in and we're going to create a roadmap as a user you'll create a roadmap you can pull in time frames you'll create a time frame and then you're going to assign tasks to the time frame so here we're going to take and actually what we're going to do to make it really simple is we're now going to say that every task is going to need a time frame and so we will come in and do let's see we're just gonna call him uh because we don't have anything here so we're gonna call we're gonna let me uh let's just pick like here copy this because now a task will have a time frame and it's going to have a foreign key to time frame and the verbose name is going to be time frame oops i'm going to do it this way so now we're going to be able to do that and i do want to do uh as we've seen before here we go so you can have a null and a blank and we're going to allow that uh technically we're probably not going to have that so but i guess we could we could have tests that are not tied to time frames so what we'll do is we'll come in we'll create road maps we'll create a time frame and then we'll be able to uh once that's done we'll be able to tie tasks uh to a time frame and so we're gonna see uh lookups and things like that through all of these so we've changed our model uh one of the things we're going to have to do and let's start with our forms so road map form we're good but task form is now going to have the time frame whoops which again i need to do it like that and uh we need to create for our model over here we need to create a form for our time frame so we don't have one so let's do i'll keep this so i can keep up with what i need to deal with for my time frame and i'm just going to replicate this rather quickly and this is not the roadmap form this is going to be my time frame form and the model is going to be models dot time isn't going to kick it nope it's not going to give me the auto complete so it's going to be uh models.time frame and the fields are going to be a little different here because we still have a name but we also have a roadmap and a time frame oh which is the time frame in itself let's change that to period instead and he's going to be time frame actually we'll just go ahead and change the whole thing so that's going to be period choices oops i'm going to change that over another one my mistake so we're going to call him period instead of time frame and we're going to start with something moderately simple here let's say we don't have a hidden input and we're not using dates or anything like that but we will keep the name uh we're gonna have that so that's standard size so now let's uh so that should be our time frame form now let's go back over here and we're gonna change that period so we're gonna actually do a little bit of tweaking here but we're gonna see this when we update when we do our migrations we're going to see this stuff get cleaned up for us we're going to rename this to period and let's see task is done there so we got our task form updated uh so let's see so roadmap task oh um oh we've got roadmap here so we have those we have let's group these a little bit so we're going to group our task related stuff group our roadmap related stuff and now we're basically going to have those same things i'll keep it somewhat similar and this is going to be for a time frame but we're just going to use tf as the abbreviation for the url just to keep it a little bit simpler and we're going to be able to create a time frame uh list time frames time frames and edit time frame so we've got those three create list and edit and we're going to come over to views wherever that went there we go and let's see so if we can maybe steal these create lists and well we'll start we'll push this to the bottom and we also need create tasks so where is create there it is and we're not going to bother with our delete yet so each of these was time frame and let's just copy and paste that name so we can get that done right so we're going to take him there we're going to edit it we're going to list it and we're going to create it and i think i had an s at the end of this if i look back over here where did i put that on my urls i had list time frames okay so that's good so that's multiple and now uh again we're going to fairly quickly be able to fly through these things and make our changes so that was actually it's the time frame object let's make sure yep i already got that upstairs upstairs up at the top of the page so let's jump back to the bottom and let's see i don't really need to worry about an owner because they don't exist in this case this is no longer the time frame for task form it's the time frame form we'll keep that the same let's see we don't really have to worry about delete i will leave it in there even though we're not actually going to uh well i guess we can we could take it through here so uh let's see so we're gonna do that that's our id record deleted he's gonna go instead to tfs again this is a time frame form whoops and we use this instance data form form form save redirect to tfs yen valid record good edit time frame form title message and it's going to do to time frame edit because we're going to and we'll have to make that so task edit we're just duplicate that and we're going to call him or her if you want to be picky about it time frame edit and we're also going to need uh task list is going to become time frame list so we had our two tasks we have our time frame so we're getting ourselves somewhat going here and they'll look somewhat similar because we are this makes it a little easier because we're sort of staying the same as far as some of our parameters that are going in uh here let's see so we do like list we have titles and tasks we could keep that but we're gonna we'll clean that up a little bit just for uh user's sake but if we wanted we could call this items or something like that and then or i'm sorry this part the variable would be items we're just gonna pass different items in and we could probably use actually the same form for the most part um especially for the listing especially because everybody's got a name there's some ways we can do this that we could make it really easy to limit our code and not have to reproduce stuff almost almost at all so this could be all time frames because we are getting all of them we're just going to call this tfs time frames and this is going to be tfs time frames because i don't feel like typing as much and um let's just call this frame uh no because framework it won't like that so we're going to call this we'll just keep it time frames and this is going to go to time frame list create a time frame we're going to clean this up here it's going to be a time frame form and create new record create a time frame time frame form come in let's see invalid record blah blah blah blah blah blah blah time frame edit and so we've cranked those out real quick and so let's go look at our time frame edit uh let's see it's actually in pretty good shape uh there's nothing we have to do specific there so it actually could be we could actually send it to task edit so we could do like generic edit send it there but we're not going to do that right now um let's see and then so oh timeframe list so now this one's where we're going to deal with this a little bit because uh so complete task doesn't really matter for a task and yeah let's get rid of that for now uh and it wasn't tasks it's time frames and for uh we'll just call it tf so time frame in time frames and then there's gonna be a class um let's call it time frame uh this is gonna be a css style so we had a task uh let's fix that real quick so we had tasks and this is going to be [Music] oh sorry control c control v and then we're just gonna call it time frame for now we're going to leave it the same as a task but we're going to come back and make some changes to it at some point so let's go back to our time frame edit did we oh shoot that was the wrong page it's probably not going to like me let's see if i can get back over here let's see three two one so let's make sure we save this when we do our edit we can go to our list and let's go back here so we have a time frame it's going to be instead we're going to give it an id of tf underscore it's going to be tfid the name is going to be the time frame name we don't need to have a due date actually most of this stuff i don't think we're going to have let's get rid of our break there we don't need a status we don't need a time we do want an edit and we don't need a complete and so it's gonna go to uh time frame and it's gonna be time frame id no time frames available and so that's going to give us our uh listing let's see i think we'll do a file save all so let's go play around and see if we can do our whoops let's see uh well that's right that one works i want to do my make migrations because we made some changes to the model uh timeframe is not defined so i missed something somewhere in models line 21. okay oh this may be a issue that we have so line 21 time frame has not been created yet so uh because this is gonna go top to bottom i don't know if we've mentioned this before you can't add something that refers to something that's defined later in the file so this time frame that we refer to has to already be created so if we do that let's see if that works for us time frame choice oops i didn't change my when i changed it i didn't get everything's changed properly period choice oh this needs to be period choices and i think that will do it so now we make migrations uh let's see i know field time frames testify for task so let's take a look at that time frame time frame got it oh let's see what am i complaining about here it's probably somewhere else so if i go to oh forms line 28 so there's something wrong there so let's go to our forms 28 there's a task form oh i bet task form is time frame let's see what i complain about let's look again it said that let's see unknown field time frame specified for task so if we go look at task uh in our models where's our models there's our models time frame lowercase um that's the verbose name so the actual one is lowercase is how we're gonna list uh access it where did i go to my forms so here that's not capital t it's lowercase t time frame hopefully that got all the things right let's see so did you rename that to period yes because we did rename it and so now we can do migrate and so now we should be able to run it and if we go to our link over here and log in then we can see things like uh let's see i think roadmap we had so we could go in and we can edit a roadmap now what we don't have is a time frame so we're just going to call it uh tfs to get us that time frame list uh and so it's going to say cannot resolve due date oh i've got something left over here oh there we go i've got an order by so i've got to go fix that and so if i go to view i had an order by in list so it's order by name and that probably will fix it and there we go no time frames available so we covered a lot of ground i'm going to call it a a session right now and um we will come back around next time and we're going to get a little deeper into hooking our tasks and time frames and road maps together so as always uh thanks for listening we do have you'll see this tag day 30 on our github as far as the code that i'm gonna that we've looked at today and then as always go out there have stuff a great day and we will talk to you next time
Transcript Segments
well hello and welcome back
we are continuing our uh python and
django series of sessions
and uh we last time we we discussed
the uh the road map we added a road map
and a time frame
we have the ability to list and edit
road maps
so we're going to start working on the
time frame now one thing we're going to
adjust here we've got a
couple things we're going to do is uh a
time frame
is actually going to be tied to a
roadmap it's not going to tie
a task necessarily to
it's it's not going to be a direct link
there because we'll have a single time
frame
for example annual that would have
multiple tasks related to it and this is
uh a little bit to just help us in how
we're going to do this from a user
experience point of view
and that being that we're going to come
in and we're going to create a roadmap
as a user you'll create a roadmap
you can pull in time frames you'll
create a time frame
and then you're going to assign tasks to
the time frame
so here we're going to take
and actually what we're going to do to
make it really simple is we're now
going to say that every task is going to
need
a time frame and so we will come in
and do let's see we're just gonna call
him
uh because we don't have anything here
so we're gonna call we're gonna let me
uh
let's just pick like here copy this
because now a task will have a time
frame
and it's going to have a foreign key to
time frame
and the verbose name is going to be
time frame oops i'm going to do it this
way
so now we're going to be able to do that
and i do want to do
uh as we've seen before here we go so
you can have a null
and a blank and we're going to allow
that uh
technically we're probably not going to
have that so but
i guess we could we could have tests
that are not tied to time frames
so what we'll do is we'll come in we'll
create road maps we'll create a time
frame
and then we'll be able to uh once that's
done
we'll be able to tie tasks uh to a time
frame
and so we're gonna see uh lookups and
things like that through all of these so
we've changed our model
uh one of the things we're going to have
to do and let's start with
our forms so road map form
we're good but task form
is now going to have
the time frame whoops which again
i need to do it like that
and uh we need to create
for our model over here we need to
create
a form for our time frame
so we don't have one so let's do
i'll keep this so i can keep up with
what i need to deal with for my time
frame and i'm just going to replicate
this rather quickly
and this is not the roadmap form this is
going to be my time frame form
and the model is going to be models dot
time isn't going to kick it nope it's
not going to give me the auto complete
so it's going to be uh
models.time frame and the fields are
going to be
a little different here because we still
have a name
but we also have a roadmap
and a time frame
oh which is the time frame in itself
let's change that
to period instead
and he's going to be time frame actually
we'll just go ahead and change the whole
thing
so that's going to be period choices
oops i'm going to change that over
another one my mistake so we're going to
call him period instead of time frame
and we're going to start with something
moderately simple here let's say we
don't have a hidden input
and we're not using dates or anything
like that but we will keep the name
uh we're gonna have that so that's
standard size
so now let's uh so that should be our
time frame
form now let's go back over here and
we're gonna change that period so we're
gonna actually
do a little bit of tweaking here but
we're gonna see this when we
update when we do our migrations
we're going to see this stuff get
cleaned up for us we're going to rename
this to period
and let's see task is done there so we
got our task form
updated uh so let's see so
roadmap task oh
um oh we've got roadmap here so we have
those
we have let's group these a little bit
so we're going to group our task related
stuff
group our roadmap related stuff
and now we're basically going to have
those same things
i'll keep it somewhat similar and this
is going to be for a time frame
but we're just going to use tf as the
abbreviation for the url just to keep it
a little bit simpler
and we're going to be able to create a
time frame
uh list time frames
time frames
and edit time frame
so we've got those three create list and
edit and we're going to come over to
views wherever that went there we go
and let's see so if we can maybe steal
these create
lists
and well we'll start we'll push this to
the bottom
and we also need create tasks so where
is create there it is
and we're not going to bother with our
delete yet
so each of these was time frame
and let's just copy and paste that name
so we can get that done right so we're
going to take him there we're going to
edit it
we're going to list it and we're going
to create it
and i think i had an s at the end of
this if i look back over here where did
i put that
on my urls i had
list time frames okay so that's good so
that's multiple
and now uh again we're going to fairly
quickly be able to fly through these
things and make our changes so
that was actually it's the time frame
object let's make sure
yep i already got that upstairs upstairs
up at the top of the page
so let's jump back to the bottom and
let's see i don't really need to worry
about an owner because
they don't exist in this case this is no
longer the time frame for
task form it's the time frame form we'll
keep that the same
let's see we don't really have to worry
about delete i will leave it in there
even though we're not actually going to
uh well i guess we can we could take it
through here so uh let's see so we're
gonna do that that's our id
record deleted he's gonna go instead to
tfs
again this is a time frame form whoops
and we use this instance data form form
form save redirect to tfs
yen valid record good edit time frame
form title message and it's going to do
to
time frame edit because we're going to
and we'll have to make that so
task edit we're just duplicate that
and we're going to call him or her if
you want to be
picky about it time frame edit
and we're also going to need uh task
list is going to become
time frame list
so we had our two tasks we have our time
frame so we're getting ourselves
somewhat going here and they'll look
somewhat similar because we are
this makes it a little easier because
we're sort of staying the same
as far as some of our parameters that
are going in
uh here let's see so we do like list
we have titles and tasks we could keep
that but we're gonna we'll clean that up
a little bit
just for uh user's sake but if we wanted
we could call this items or something
like that
and then or i'm sorry this part the
variable would be items
we're just gonna pass different items in
and we could probably use actually the
same
form for the most part um especially for
the listing
especially because everybody's got a
name there's some ways we can do this
that we could make it
really easy to limit our code and not
have to reproduce stuff almost
almost at all so this could be all
time frames because we are getting all
of them
we're just going to call this tfs time
frames and this is going to be tfs
time frames because i don't feel like
typing as much
and um let's just call this frame
uh no because framework it won't like
that so we're going to call this we'll
just keep it
time frames and this is going to go to
time frame list
create a time frame we're going to clean
this up here
it's going to be a time frame form and
create new record create a time frame
time frame form
come in let's see invalid record blah
blah blah blah blah blah blah time frame
edit
and so we've cranked those out real
quick and so let's go look at our time
frame edit
uh let's see it's actually in pretty
good
shape uh there's nothing we have to do
specific there
so it actually could be
we could actually send it to task edit
so we could do like generic edit
send it there but we're not going to do
that right now
um let's see and then so oh timeframe
list
so now this one's where we're going to
deal with this a little bit because
uh so complete task doesn't really
matter for a task
and yeah let's get rid of that for now
uh and it wasn't
tasks it's time frames
and for uh we'll just call it tf
so time frame in time frames
and then there's gonna be a class um
let's call it time frame
uh this is gonna be a css style so we
had a task uh let's
fix that real quick so we had tasks
and this is going to be
[Music]
oh sorry control c control v
and then we're just gonna call it time
frame
for now we're going to leave it the same
as a task but we're going to come back
and make some changes to it at some
point so
let's go back to our time frame edit
did we oh shoot that was the wrong page
it's probably not going to like me let's
see if i can get back over here
let's see
three two one
so let's make sure we save this when we
do our edit
we can go to our list
and let's go back here so we have a time
frame it's going to be
instead we're going to give it an id of
tf underscore
it's going to be tfid the name is going
to be the
time frame name we don't need to have a
due date
actually most of this stuff i don't
think we're going to have let's get rid
of our break there we don't need a
status we don't need a time
we do want an edit
and we don't need a complete
and so it's gonna go to uh time frame
and it's gonna be time frame id no time
frames
available
and so that's going to give us our
uh listing let's see i think
we'll do a file save all so let's go
play around and see if we can do our
whoops
let's see uh well that's right that one
works i want to do my
make migrations because we made some
changes to the model
uh timeframe is not defined so i missed
something somewhere in models line 21.
okay
oh this may be a issue that we have
so line 21 time frame has not been
created yet
so uh
because this is gonna go top to bottom i
don't know if we've mentioned this
before
you can't add something that refers
to something that's defined later in the
file
so this time frame that we refer to has
to already be created
so if we do that let's see if that works
for us
time frame choice oops i didn't change
my
when i changed it i didn't get
everything's changed properly
period choice oh this needs to be
period choices
and i think that will do it
so now we make migrations uh let's see i
know field time frames testify for task
so let's take a look at that
time frame time frame got it
oh let's see what am i complaining about
here it's probably somewhere else so if
i go to
oh forms
line 28 so there's something wrong there
so let's go
to our forms 28 there's a task form
oh i bet
task form is time frame let's see what i
complain about
let's look again it said that
let's see unknown field time frame
specified for task so if we go look at
task
uh in our models where's our models
there's our models
time frame lowercase um that's the
verbose name so the actual one is
lowercase is how we're gonna
list uh access it where did i go to my
forms
so here that's not capital t it's
lowercase t
time frame
hopefully that got all the things right
let's see
so did you rename that to period yes
because we did rename it
and so now we can do migrate
and so now we should be able to run it
and if we go to our link over here and
log in then we can see things like
uh let's see i think roadmap we had so
we could go in and we can edit a roadmap
now what we don't have is a time frame
so we're just going to call it uh tfs
to get us that time frame list
uh and so it's going to say cannot
resolve due date oh i've got something
left over here
oh there we go i've got an order by so
i've got to go fix that
and so if i go to view i had
an order by in list
so it's order by name
and that probably will fix it and there
we go no time frames available
so we covered a lot of ground
i'm going to call it a a session right
now
and um we will come back around next
time
and we're going to get a little deeper
into hooking our tasks and time frames
and road maps together so
as always uh thanks for listening we do
have you'll see this tag
day 30 on our github as far as the code
that i'm gonna
that we've looked at today and then as
always go out there have stuff a great
day
and we will talk to you next time