Detailed Notes
This tutorial goes into some debugging steps and moving the UX form buttons to some clickable DIVs.
You can view source for today and all prior days by reviewing the tag Day 43 at this GitHub (this one includes day 42 as well): https://github.com/robbroadhead/develpreneur-pythontutorial
Transcript Text
[Music] well hello and welcome back we are going to continue we're continuing our django in python application and we're doing a little bit of uh some updates and things like that we're going to catch a little bugs and clean a few things out right now so first thing we want to do is let's get rid of this edit button on our road maps and we're gonna do this a couple places so that when we click on a card we're gonna go right to edit so if we look up here in our roadmaps if we go to our views and we go to road maps which is in our list somewhere in there there we go list road maps so in our roadmap list this is going to be actually fairly simple what we're going to do is we're going to take this button on click edit and all we're going to do is move our on click up to the div and then we can remove our button i'm going to do this a couple places and it's going to just simplify our whoops i don't need that i do need that and so now when i refresh it if i'm going to go to annual goals 2021 click on it and that's going to get here so we're going to do this here at our uh this is our roadmap detail we're going to do the same thing so that's our roadmap edit again we're gonna move a few of these things around and get rid of these buttons like that and if we look here now see here and now we're going to do it in our time frame so we're going to do the same whoops go here so if i do a time frame edit so you see this is actually fairly easy to do and it just cleans up the interface a little bit as if we move these clicks that we've gone through now the button is nice initially uh particularly while we're designing things so we can go through and we can look at it and say yes this needs to be this is something that makes sense from a navigation point of view to have a button or from a click so now look we're cleaning this stuff up pretty quick oops i moved the wrong button down there at the bottom so that was actually the complete i don't want the complete i want the oh i just want this just this event and then get rid of that button and then this would be a case sometimes that you would need you'd maybe want to have multiple buttons or actions or links or something like that because of the complete option but this sort of you know sort of nice there so let's actually take that and if we go up to our road maps let's see actually let's look at our tasks see how we've got this set up let's do this in our as we get down to our what is that that's our goals let's clean that up so that it gets done a little bit better and we're going to get rid of this whole thing here we've we don't have any space at the bottom we didn't build that out right so i'm going to cheat it a little bit uh let's see so this is going to be is that time frame it's time frame edit so the first thing i want to do is i'm going to clean this up a little bit so let's take ah that doesn't look too bad all we're going to do is now we're going to split this into two divs so the first one actually we can do it from here because we're going to move the buttons going to be in a different div and we're going to use that spacing much as we did on the task list so let's take a look at how do we split that out let's see so it was a button task which we may keep at that let's change that but that class over so we'll go over here and he's going to be instead of a button info he's going to be button task and let's go back to that guy we had him split but we had them split actually a couple places we had these remember we do this by 12 there's 12 divisions across the bootstrap so we've got 3 4 which is 7 plus 2 is 9 and 3 is 12. so what we're going to do is we're just going to go ahead and do just two of these this time and let's see how that looks so if we do oops and that's in the let me just pull the that's all i need because i've already got a class for both of those divs so his class is tasks and he's going to be an md9 and this one oh he doesn't need one so it's going to be an md3 and let's take a look at how that looks so we go here and we see oops i did not put i want him inside the div so whoops so i need to have my overall card which i'm going to click on to edit and then within it i'm going to have two divs so i'm going to change this up a little bit because this is going to be now so i'm going to have a div oops here oops i just duplicated that on me oops okay i did not paste that right so let's do it this way so i'm going to take that and so i've got a name and status it's going to be a dive and he's going to be an md9 while the other one's going to be within there and he's going to be an md3 and if we look there we go so now he's but he's on a different page so let's oh so we got to wrap those as a row i'll do the whole thing can i have a div row somewhere i do not have one so i'm just going to grab one more of those so now i'm going to combine those guys like that and we should be able to say well there we go so now we've got our completes down here and if we click on them we can edit it but let's get some space down there and i'm going to do it in the most blatant easy way to do it at this point is i'm just going to throw some breaks in there we'll come back to this another time and probably play around with that a little bit but for now let's just open that up a little bit and so now actually i'm just going to give myself a little bit of space here so as i scroll down i've got some space at the bottom i could open that up or close that up a little bit more if i wanted but for now we're going to keep it that way so we come in let's start with road maps we click here we can look at the children and we can look at a given time frame so i think we're good because we've got our goals we've got here if we edit nothing there turn annual personal goals annual goals and so uh what we oh and then we have here we can go back up we didn't actually keep our little button here because we can just get room app to get back uh there's two of these actually now because we've got we're in home or task list then oops first let's get these so if i click on it we're gonna get rid of the edits for the to do and the tasks which is probably both going to be a task list i think this will cover both of them so let's see for the edit we're going to get rid of that and we'll actually do it all the way up at the card level whoop is that how i want to do it yes so for each task i'm going to click on it there and so now i can get rid of edit and i don't need the break so if i save it i got rid of that and i'm getting a matching query does not exist which will be interesting uh let's see we are blowing up in views it's going uh line 127 oh the parent it's probably because that does not exist so if it has no parent then we're probably blowing up so let's take a look at that if we go look at that guy we will see that uh owner oh that's not owner i don't have parent mi task so i did not add that in there for some reason parent attachment time cement owner let's go take a look at that so if i go back in my look at my model real quick to edit edit task and i think it gave me that at line 127. so line 127. so oh it's the time frame objects get so if there's a p is in the request.session so that means if there's a parent then he's going to try to get that one and so let's just do this real quick and let's see what it's spitting out for us if we rebuild that whoops did it die on me where here we go oh i need my parentheses there so i need to go back to my view my mistake and so we're probably going to need to do is clean this stuff out oh which we do need to do because that is that's our problem is when we do a let's see so what we need to do is we need to unset our session when we do a list because as we come into whoops uh is it gonna let's see can i show it to me yeah so if i go into my list so here we don't have remember we set our roadmap and time uh time period that we're setting those because we had that context well we don't have that context anymore so what we need to do is we need to do a clean session and we're just going to call that when we do list tasks so here he needs to do i think you can do request.clean session so actually i don't think we to do it i think we need to do it like this let's sit this way there because it's not a self my mistake so if we do clean session now what it's going to do is it still getting it oh it says it is so let's make sure that we clean out our session properly so now oops it's probably because i'm not cleaning the right one so let's do this one so that's list tasks oh and this is going to be the list tasks with oh that's edit tasks oops so we have to do it here i'm still getting it so let's take a look at that so tasks is calling uh tasks is calling list tasks so list tasks calls clean session and so let's just do this well actually what i need to do is uh if he's in the session and not equal to null i'm sorry not equal to none because that's what's going to happen as it's coming through oh and that's some and so what's it complaining about one second here there we go i think that's gonna work there we go so now we don't have uh and so now this return to annual goals is going to blow up because it doesn't really have um i don't think we have the right yeah we're setting this incorrectly so if we go into the edit task let's see here uh parent equals parent otherwise it equals none so if we look here where it's just going to be on um edit task well actually as i'm looking at the clock we're running out of time so i'm going to actually fix this next time around but what we did do this time around is we're clicking on our stuff now to edit as opposed to these edit buttons everywhere i think that'll take care of all of our edits and we have to deal with the side effects of setting stuff up in the session which is part of the reason that it was it's cleaner when you pass it um but it's also sort of nice to you know from a convenience point of view to keep track of those sessions and keeps track of stuff within the session so we're going to clean that up next time but for now we'll wrap it up so go out there have yourself a great day a great week and we will talk to you next time you
Transcript Segments
[Music]
well hello and welcome back
we are going to continue we're
continuing our django in python
application and we're doing a little bit
of uh some updates and things like that
we're going to
catch a little bugs and clean a few
things out right now
so first thing we want to do is let's
get rid of this edit button on our road
maps
and we're gonna do this a couple places
so that when we click on a card
we're gonna go right to edit so if we
look up here
in our roadmaps
if we go to our views
and we go to road maps
which is in our list somewhere in there
there we go list road maps so in our
roadmap
list
this is going to be actually fairly
simple what we're going to do is we're
going to take this button on click edit
and all we're going to do is move our on
click
up to the div
and then we can remove our button
i'm going to do this a couple places and
it's going to just simplify
our whoops i don't need that i do need
that and so now
when i refresh it if i'm going to go to
annual goals 2021
click on it and that's going to get here
so we're going to do this here
at our uh this is our roadmap detail
we're going to do the same thing
so that's our roadmap edit again
we're gonna move a few of these things
around
and get rid of these buttons
like that and if we look here now
see here and now we're going to do it in
our time frame so we're going to do the
same whoops
go here
so if i do a time frame edit
so you see this is actually fairly
easy to do and it just cleans up the
interface a little bit as if we move
these clicks that we've gone through now
the button is nice
initially uh particularly while we're
designing things so we can go through
and we can
look at it and say yes this needs to be
this is something that makes sense
from a navigation point of view
to have a button or from a click so now
look we're cleaning this stuff up pretty
quick oops i moved the wrong button down
there
at the bottom so that was actually the
complete i don't want the complete
i want the
oh i just want this just this event
and then get rid of that button
and then this would be a case sometimes
that you would need you'd maybe want to
have multiple buttons or
actions or links or something like that
because of the complete option
but this sort of you know sort of nice
there so let's actually take that
and if we go up to our road maps
let's see actually let's look at our
tasks see how we've got this set up
let's do this
in our as we get down to
our what is that that's our goals let's
clean that up so that
it gets done a little bit better and
we're going to get rid of this whole
thing here we've we don't have any space
at the bottom
we didn't build that out right so i'm
going to cheat it a little bit
uh let's see so this is going to be
is that time frame it's time frame edit
so the first thing i want to do is i'm
going to clean this up a little bit so
let's take
ah that doesn't look too bad all we're
going to do
is now we're going to split this into
two divs
so the first one actually we can do it
from here because we're going to move
the buttons going to be in a different
div
and we're going to use that spacing much
as we did on the
task list so let's take a look at how do
we split that
out let's see so it was a button task
which we may keep at that let's change
that but that class over
so we'll go over here and he's going to
be
instead of a button info he's going to
be button task
and let's go back to that guy we had him
split but
we had them split actually a couple
places we had these remember we do this
by 12
there's 12 divisions across the
bootstrap so we've got 3 4 which is 7
plus 2 is 9 and 3 is 12. so what we're
going to do is we're just going to go
ahead
and do just two of these this time
and let's see how that looks so if we do
oops and that's in the let me just pull
the
that's all i need because i've already
got a class for both of those
divs so his class is tasks and he's
going to be an
md9 and this one oh he doesn't need one
so it's going to be
an md3 and let's take a look at how that
looks
so we go here and we see oops i did not
put
i want him inside the div so
whoops so i need to have my overall card
which i'm going to click on to edit and
then within it
i'm going to have two divs so i'm going
to change this up a little bit because
this is going to be now
so i'm going to have a div oops here
oops i just duplicated that on me
oops okay i did not paste that right so
let's do it this way so i'm going to
take that
and so i've got a name and status it's
going to be a dive
and he's going to be an md9 while the
other one's going to be within there and
he's going to be an md3
and if we look there we go so now he's
but he's on a different page
so let's oh so we got to wrap those as a
row
i'll do the whole thing can i have a div
row somewhere i
do not have one so i'm just going to
grab one more of those
so now
i'm going to combine those guys
like that
and we should be able to say well there
we go so now we've got our completes
down here and if we click on them we can
edit it
but let's get some space down there
and i'm going to do it in the most
blatant easy way to do it at this point
is i'm just going to throw some
breaks in there we'll come back to this
another time
and probably play around with that a
little bit but for now let's just open
that up a little bit
and so now actually i'm just going to
give myself a little bit of space here
so as i scroll down i've got some space
at the bottom i could
open that up or close that up a little
bit more if i wanted but for now
we're going to keep it that way so we
come in
let's start with road maps we click here
we can look at the children
and we can look at a given time frame
so i think we're good because we've got
our goals
we've got here if we edit nothing there
turn annual personal goals annual goals
and so uh what we oh and then we
have here we can go back up we didn't
actually keep our little button here
because we can just get room app to get
back
uh there's two of these actually now
because we've got
we're in home or task list
then oops first let's get these so if i
click on it we're gonna get rid of the
edits for
the to do and the tasks
which is probably both going to be a
task list
i think this will cover both of them so
let's see for the edit we're going to
get rid of that
and we'll actually do it all the way up
at the card level
whoop is that how i want to do it yes so
for each task i'm going to click on it
there and so now i can get rid of edit
and i don't need the break
so if i save it i got rid of that
and i'm getting a matching query does
not exist which will be
interesting uh let's see we are blowing
up in views it's going
uh line 127 oh the parent
it's probably because that does not
exist so if it has no parent then we're
probably blowing up so let's take a look
at that
if we go look at that guy
we will see that uh owner
oh that's not owner i don't have parent
mi task
so i did not add that in there for some
reason parent attachment time cement
owner let's go take a look at that
so if i go back in my look at my model
real quick to edit
edit task
and i think it gave me that at line 127.
so line 127.
so oh it's the time frame objects get
so if there's a p is in the
request.session
so that means if there's a parent then
he's going to try to get that one
and so let's just do this real quick
and let's see what it's spitting out for
us
if we rebuild that whoops
did it die on me where here we go
oh i need my parentheses there
so i need to go back to my view
my mistake
and so we're probably going to need to
do is clean this stuff out oh which we
do need to do because that
is that's our problem is when we do a
let's see so what we need to do is we
need to unset
our session when we do
a list because as we come into whoops
uh is it gonna let's see can i show it
to me
yeah so if i go into my list so here we
don't have
remember we set our roadmap and time
uh time period that we're setting those
because we had that context well we
don't have that context anymore
so what we need to do is we need to do a
clean session
and we're just going to call that when
we do list tasks so here
he needs to do i think you can do
request.clean
session
so
actually i don't think we to do it i
think we need to do it like this let's
sit this way
there because it's not a self my mistake
so if we do clean session now
what it's going to do is it still
getting it oh it says it is so let's
make sure
that we clean out our session properly
so now
oops it's probably because i'm not
cleaning the right one so let's do this
one so that's list tasks
oh and this is going to be the list
tasks with
oh that's edit tasks
oops so we have to do it here
i'm still getting it so let's take a
look at that so tasks
is calling
uh tasks is calling list tasks
so list tasks calls clean session
and so let's just do this
well actually what i need to do is uh
if he's in the session and
not equal to null i'm sorry not equal to
none
because that's what's going to happen as
it's coming through
oh and that's some and
so what's it complaining about one
second here
there we go i think that's gonna work
there we go so now we don't have uh and
so now this return to annual goals
is going to blow up because it doesn't
really have um
i don't think we have the right yeah
we're setting this incorrectly so if we
go into the edit task
let's see here uh parent equals parent
otherwise it equals none
so if we look here where it's just going
to be on
um edit task
well actually as i'm looking at the
clock we're running out of time so i'm
going to actually fix this next time
around but what we did do
this time around is we're clicking on
our stuff now to edit as opposed to
these
edit buttons everywhere i think that'll
take care of
all of our edits and we have to deal
with the
side effects of setting stuff up in the
session which is
part of the reason that it was it's
cleaner when you pass it
um but it's also sort of nice to
you know from a convenience point of
view to keep track of those sessions
and keeps track of stuff within the
session so we're going to clean that up
next time but for now we'll wrap it up
so go out there have yourself a great
day a great week and we will talk to you
next time
you