Skip to content

Picker Comments Module

qqliu edited this page Apr 16, 2013 · 7 revisions

The most recently added functionality to Course Picker is the comments module. The comments module is based on the Django module-django comments. In order to change any of its functionalities, modify the Python files with the Scripts directory of Picker.

If you do not know Django, I suggest that you read The Django Book and Writing your first Django app. Django, as far as I've seen, gets updated really quickly and each update has often had incompatibility with previous versions (functions become deprecated quite often). MIT Scripts currently runs on Django 1.5 but if for some reason, the site seems to not function correctly in the future, check for deprecation in the code.

Here is a brief overview of the files within the directory and what you would need to modify to add functionality:

settings.py:
-defines the admins
-defines which database the app uses
-sets the paths for static files, templates, and media files
-contains list of "Installed Apps" used by the project

urls.py
-maintains the list of valid urls used by the module

viewcomments
urls.py:
-defines the key urls with the "Detailed Comments" page of each class
-IMPORTANT: 'class-comments' renders the comments on the "See all comments" page
views.py:
-defines the views for viewcomments: ClassDetailView is used for displaying the "Detailed Comments" page models.py:
-defines the "models" or objects that can be viewed. The key object here is MITClass which has all the attributes that all displayed on the "Detailed Comments" pages
admin.py:
-defines what shows up in the admin

django-comments-xtd: Has more files that govern aspects of the Picker comments module.

Static files or TEMPLATES are found under the web_scripts directory for Picker (web_scripts/alpha/classcomment/static). They have to be in this directory because it is the only publicly viewable directory and static files must be placed in such a directory. Please add all new templates under this directory.

Clone this wiki locally