Checklist Extension

The checklist extension is to help reviewers keep track of what they should check for while reviewing. I have created preliminary front-end designs of what the checklist could look like and work like, but now that I’m implementing the back-end, I realized that things were not as clear in my head as I thought they would be. This blog post is mostly going to address the relationships the checklist would have with the other models.

So, so, so… I think the biggest source of misunderstanding on my part is how reviews are actually made. I thought they were created when a user views a review request, or a draft of one is fetched at that time. However, it turns out that while a {{review}} variable is accessible through the template, this does not necessarily mean that there is already a review object associated with that user and review request. A review is only created when the user begins to comment on the review request.

I initially planned to use the review ID as a foreign key to an instance of my checklist, because I thought that a reviewer might want different lists for each review (even if it is for the same request). And so learning that a review is only created after the user begins commenting gave me a little chicken-and-egg problem: the checklist needs to be there before the user begins the review, but there would be no review until the user begins to comment. Well, David suggested that I use the review request ID and user ID as the foreign keys instead. Even if users can review the same request multiple times, we’d leave the resetting/updating of the checklist up to the user. At least for now.

So, important things that might be worth noting at this point:

  • A review is created when a user begins commenting on a review request.
  • The {{review}} variable in the template references a pending review. If there is not one, it would be None.
  • Users can review the same request any number of times.
  • Users should be able to start a checklist without starting a review.
  • The status of a checklist should be preserved for a particular user and review request (even if there’s no review).

With these in mind, I have edited my schema for my checklist models:

Checklist (
checklist-ID             PRIMARY KEY,
review-request-ID,
user-ID
FOREIGN KEY (review-request-ID, user-ID)
)

ChecklistItem (
checklist-item-ID      PRIMARY KEY,
checklist-ID,
description,
isFinished,
FOREIGN KEY (checklist-ID)
)

And… well, that’s all for now. =D

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s