GitLab now enforces expiry dates on tokens that originally had no set expiration date. Those tokens were given an expiration date of one year later. Please review your personal access tokens, project access tokens, and group access tokens to ensure you are aware of upcoming expirations. Administrators of GitLab can find more information on how to identify and mitigate interruption in our documentation.
| 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 ... |