Level 2In this phase you will write a basic version of the web application that candisplay but not create job listings. This means we dont yet have to worry about loginand sessions but that you must interface to the database to lists positions.Following the model-view-controller architecture, the first thing that youllimplement is the database model. This is contained in a module interface.pywith all of the code to retrieve and store positions in the database.You will then implement the views (templates) and controllers for the web applicationthat makes use of the models present the data on the web.All of the work you do will be tested using unit tests. For the database interface,there are straightforward unit tests of the functions that you will write. To test thebehaviour of the web application well use functional testing that requests your pagesand checks that they have certain contents, and that we can login and positionmessages. We will do this using a module called that is designed specificallyfor functional testing of Python web applications.Unit TestsAll procedures will be implemented inthe module interface.py. A version has been supplied that contains the procedurestubs only.When we refer to a database connection below we mean the connection returned by COMP249Db from the database module that we provide. This is just aregular SQLite database connection, but the code we provide ensures we cancontrol which database you are using for testing purposes.position_listThere is a function position_list(db, limit=10). db is a database connectionand the optional argument limit is an integer. The function returns a list of tuplesrepresenting the positions stored in the database, each tuple contains: (id, timestamp, owner,title,location, company, description).Messages are returned in reverseorder of the timestamp, most recent first.position_getThere is a function position_get(db, id). db is a database connectionand id is an integer position identifier.The function returns a tuplerepresenting the position with the given id,the tuple contains: (id, timestamp, owner, title,location, company, description).If the id does not match a record in thedatabase, the function should return None.position_addThere is a function position_add(db, usernick, title, location, company, description). db is a database connection, the argument usernick is a user name and title, location, company and description are the values ofthe respective fields in the positions table. The function adds the new positionto the database.If usernick does not a user in the users table, no new record shouldbe created and the function should return FalseIf the record is added successfully, the function should return True.Functional requirementsThe functional requirements describe what a user should be able to see and doon the web application. They describe what happens when you load a particular URLor submit a form. in a page. There are automated tests to check that you haveimplemented this functionality correctly.Home Page List of positionsAs a visitor to the site, when I load the home page (URL /) I see a list ofup to 10 positions in order of their timestamps, most recent first. Each positionmust include the position timestamp, title, owner and the first 100 characters ofthe text of the position description. At the end of each listingshould be a link to view the entire position with the text &"Read More&" and theurl /positions/DDwhere DD is the position id.The list of positions that appears should be theresult of a call to position_list which will extract the most recent10 positions from the database.Position PageAs a visitor to the site, I can click on the &"Read More&" link after a positiondescription on the home page, I see a page with the full description of theposition at the URL /positions/DD where DD is the position id.The position page should contain all of the database fields for the position, laid outin a readable way. It should also contain a link to return to the main page.Your TaskTo achieve these requirements you need to write code in interface.py to implement thedifferent functions to interface to the database. Run the unit tests in level2_unit.pyto check whether you have met the requirements.Once you have a working version of interface.py you can move on to write theapplication itself in main.py. Take each required page in turn and write thecode to generate the content using the functions you have written. You can checkthe functional requirements yourself and run the unit tests in level2_functional.pyto validate that youve met the requirements..describes theway to send queries to SQLite and get results back.looks atthe Bottle page templating system.coversrunning unit tests.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp
网友评论