Skip to content
Snippets Groups Projects
Commit 268fd0a0 authored by Farhan Faiyaz's avatar Farhan Faiyaz
Browse files

Update README.md

parent d74eba19
Branches
No related merge requests found
......@@ -10,21 +10,21 @@ Doing this is another way of showing that you understand the code you wrote!
| Checklist point | Evidence (filename(s) and line number(s) and/or short desciption) |
|-------------|------------|
| write a simple server script which is capable of serving a web application written in Python | |
| retrieve one or more documents or rows from one or more collections or tables | |
| iterate over documents returned in a results cursor object | |
| filter and/or sort documents in the result set based on some simple criteria | |
| perform more advanced filtering and/or aggregation operations in a database query | |
| handle a POST request made via an HTML form in a server-side script | |
| demonstrate consideration for Separation of Concerns through the modularisation (separation) of related code | |
| demonstrate an awareness of how related data is modelled in the database | |
| design and implement an original functional feature in a Python web app | |
| other relevant extension of the taught material (if applicable) | |
| make a Python script self-executable | |
| utilise a range of Python's built-in functions and methods | |
| make use of user-defined functions | |
| design and implement reuseable functions | |
| write readable, well-presented code | Everywhere?! |
| write a simple server script which is capable of serving a web application written in Python | mysimpleServer.py |
| retrieve one or more documents or rows from one or more collections or tables | cgi-bin/components.py lines 68, 118, 172, 175, 202, 208, 227, 254|
| iterate over documents returned in a results cursor object | cgi-bin/components.py line 232 |
| filter and/or sort documents in the result set based on some simple criteria | cgi-bin/components.py lines 68, 118, 172, 175, 202, 208, 227, 254 |
| perform more advanced filtering and/or aggregation operations in a database query | cgi-bin/components.py 202, 227 |
| handle a POST request made via an HTML form in a server-side script | simpleserver.py line 19 |
| demonstrate consideration for Separation of Concerns through the modularisation (separation) of related code | I have separated my code in different files and directory. I have a directory which contains all the HTML (web interface) and also another one for the CSS file which I need to make more nicely the interface. In the file myserve_cat.py I have all the checks if the buttons are pressed and printing the HTML thorugh utils.py. The file utils.py which contains the database connection and the conversion of the HTML's files in string. In the components.py I have all the functions called when the button are pressed or when is normally called inside the codes. Here I have all the query done for each different type of function. The seperations of the code improve the readblity, testibality and also reusability. |
| demonstrate an awareness of how related data is modelled in the database | cgi-bin/components.py line 35 we can see we have a insert query. In this "inser_cat" function we add to the database a new cat image given as a input. This increment the number of images and make it usable to fluck/skip. Another simple example we can find in line 279 which increment the flucks or skips depending the button pressed. |
| design and implement an original functional feature in a Python web app | cgi-bin/components.py line 281 we can see a function which is called when the user press a specific button. It will remove the current image in the database and calling the other function in line 305 which will remove all the flucks and skips. Another one we have mentioned in the question above which allows the user to insert a new cat image trhough the image URL |
| other relevant extension of the taught material (if applicable) | cgi-bin/components.py line 45 we can see a function which allows the user to login. The password is decrypted. In line 26, 58, 72, 105, 123 and more we can see how i handle some of the errors. |
| make a Python script self-executable | cgi-bin/ mysimpleServer.py, components.py, myserve_cat.py, utils.py line 1 |
| utilise a range of Python's built-in functions and methods | cgi-bin/components.py lines 37, 81, 135. cgi-bin/myserve_cat.py lines 6, 17(an all the prints), 24 |
| make use of user-defined functions | cgi-bin/components.py line 302. cgi-bin/myserve_cat.py lines 14, 33, 42, 55, 59, 63, 68, 77, 86, 93 ... |
| design and implement reuseable functions | cgi-bin/components.py lines 15, 45, 92, 159, 181, 215, 242, 262, 287 305. cgi-bin/utils.py lines 12, 34 |
| write readable, well-presented code | Everywhere?! Yes, everywhere and also all the variables name are releated on what they are used for |
## Installation instructions
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment