Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help3403


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
 
Options:
RSS cloud
Jump to:

Project 2 - Database Migrations, Schema Design, AJAX

3 of 419 articles shown, currently no other people reading this forum.
photo
From: Matthew C.
Date: Wed 13th May, 7:54pm
Actions: 
        Login-to-reply
Hi Tim, Tom and Haolin,

The marking criteria for Project 2 states

"Some evidence of DB migrations." 

As part of the data models mark. Now my models.py file was not built in one go for sure. 
However, while developing it if data was already inside the database and the 
relationships or columns or tables were changed to a significant extent, the migration 
would not occur, there where "ALTER TABLE" permission errors. To circumvent this error I 
would delete the database and then rebuild it. How would I go about providing "some 
evidence of DB migrations"? Or is it too late?

In addition, I am confident that the schema design is ok, however, this is just my 
opinion. I am wondering if there are any resources I can use to check the quality of the 
design you could refer me to.

Thirdly, the marking criteria also talk about "DOM manipulation/AJAX". I can't think of 
a reason to use AJAX and I was wondering if you could give me an example of how it would 
be implemented in this project. For context, my group has built an application similar 
to w3school with general web development trivia-style questions, with short answer 
questions, multi-choice, and fill-in-the-blank question types.

Any help would be much appreciated.

Cheers,
Matt

Project 2 - Database Migrations, Schema Design, AJAX

photo
From: Timothy F.
Date: Wed 13th May, 10:29pm
Actions: 
        Login-to-reply
"Matthew Carter"                               wrote:

> Hi Tim, Tom and Haolin,
> 
> The marking criteria for Project 2 states
> 
> "Some evidence of DB migrations." 
> 
> As part of the data models mark. Now my models.py file was not built in one go for sure. 
> However, while developing it if data was already inside the database and the 
> relationships or columns or tables were changed to a significant extent, the migration 
> would not occur, there where "ALTER TABLE" permission errors. To circumvent this error I 
> would delete the database and then rebuild it. How would I go about providing "some 
> evidence of DB migrations"? Or is it too late?

I think that's fine. Database migrations are a little bit flakey with sqlite.
 
> 
> In addition, I am confident that the schema design is ok, however, this is just my 
> opinion. I am wondering if there are any resources I can use to check the quality of the 
> design you could refer me to.
>
There's some theory on database normalisation
https://en.wikipedia.org/wiki/Database_normalization
Having 3rd normal form at least is good, but generally reducing fata redundancy and query 
complexity are the main goals.
 
> Thirdly, the marking criteria also talk about "DOM manipulation/AJAX". I can't think of 
> a reason to use AJAX and I was wondering if you could give me an example of how it would 
> be implemented in this project. For context, my group has built an application similar 
> to w3school with general web development trivia-style questions, with short answer 
> questions, multi-choice, and fill-in-the-blank question types.
> 
Giving live feedback to any question without re-rendering the whole page would be done 
with DOM manipulations, and possibly AJAX as well. 

> Any help would be much appreciated.
> 
> Cheers,
> Matt

Project 2 - Database Migrations, Schema Design, AJAX

photo
From: Haolin W.
Date: Thu 14th May, 9:15am
Actions: 
        Login-to-reply
Hi Matthew. Tim had some great points, and just to tag on and add a few more. 

Completely understand the issue with migrations, happens all the time if the migrations don't 
reflect the actual database status. As Tim said, shouldn't be a problem, but I will say that 
if you are versioning everything correctly with Git and GitHub, your migration/model changes 
should be reflected in there. Everything will be versioned.

I think Tim's resource for your second question is pretty good.

Regarding DOM Manipulation and AJAX, the best way to visualise this is more related to how 
you're setting up questions. Do you have multiple questions on the same page? How are you 
submitting them? Are you allowing drafting of questions? Do you have feedback/comments on a 
page? Questions like this will determine if you 'need' AJAX. The purpose of using AJAX in a 
project like this is really to significantly improve user experience + give you a real world 
example of how things are done with modern stacks. Take the example of having 5 questions on 
the same page. How do you allow a user to submit a draft? Your submit button with flask and 
server side rendering will refresh the entire page, and without some hacky code, will put 
them back at the top of the page. With AJAX, it allows live updates to create/modify an 
existing database field, without any movement of the page or page refreshing. Significantly 
better user experience. Just imagine if every time you sent a facebook message your entire 
browser refreshed.

Your question types and approach seem fine. Let me know if you need anything else. 
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  8:27am May 24 2020