Starting from:

$30

WEB302- Assignment 2 Solved

1.       This assignment should be uploaded to a GitHub repository which I will invite you to. When I download this GitHub repository I must be able to access all your source files so that I can see your Python code, HTML/Django template code and connect your site to a database.

2.       If you have difficulty uploading to GitHub, then you may alternatively upload your assignment as a ZIP file to MS Teams in your personal channel’s Files tab, or an online cloud storage site such as Google Drive or WeTransfer and send me a link on MS Teams in your personal channel’s Posts tab. DO NOT EMAIL ME A ZIP FILE AS AN ATTACHMENT. I WILL NOT RECEIVE IT.

Instructions: You will be creating a fully-functional MVC CRUD application using the Django framework. DO NOT USE A DIFFERENT PYTHON FRAMEWORK SUCH AS FLASK. The application will allow users to create, read, update and delete items which can belong to models of your choice (i.e. Spaceship, Dog, Clown etc.) as long as they are NOT a Musician, Album or Song – be creative. This application will store the items in a PostgreSQL database using the Django ORM and migrations. You should include a requirements.txt file which lists any PIP packages which your project depends on.

 

Your application must make use of at least 2 models. Your models must define at least 1 relationship which is either a one-to-many or many-to-many relationship. Your primary model should define at least 3 fillable fields – a name, an image and something unique to your model. Any strings must be filtered and validated using Django’s model field validation methods and the clean() method. Names should be validated using CharField() and formatted with capital first letters with the rest lowercase. Image files should use Pillow and ImageField().

 

The application should start on a View Models page which lists the names of all the items which have been added to the database for one of your models. Each item should also have a link or button to a page where you can see more information about that individual item, including relational data which comes from another model. The user should also be able to view an image which is associated with each item, but this could be displayed on either the home page or the individual item’s page. There should be a clear navigation item or button that links to an Add Model page which displays a form where users can enter properties for a new object, including a name and an image. If the user does not fill out all the required fields, or there is an error sending data to the database, then they should be presented with an error message and should not be able to proceed. If the user correctly fills out all the required fields and the data gets sent to the database then they should be taken back to the View Models page where they are presented with a success message and can see all the objects in the database, including the one they just added. Each item displayed on the View Models page should have an Edit button and a Delete button near it. When the Edit button is clicked, the user should be taken to an Edit Model page where there is a

form which is already filled out with that object’s attributes. If the user edits any of the attributes, then they should be taken back to the View Models page where the changes take effect. If the user leaves one of the required fields blank, they should be presented with an error message and should not be able to proceed. When the Delete button is clicked the selected object should be deleted from the database. If the object is successfully deleted, they should be presented with a success message. If there is an error, they should be presented with an error message. I MUST be able to add objects using the form on the Add Model page, edit objects using the form on the Edit Model page, and delete objects using the Deletion buttons.

 

Generic class-based views should be used for to transfer data from the primary model to the templates and from the templates to the model using distinct ListView, DetailView, CreateView, UpdateView, and DeleteView classes. The views for your secondary models do not need to use all the premade class-based views but should make use of CreateView, UpdateView and DeleteView at a minimum. You may display the data for your secondary models on the same pages as your primary model.

 

The application should have an intuitive and functional user interface which uses Django templates. The Django templates should make use of a base template and sections. They should also make use of Django template loops and conditionals to display data. Styling can be done using either regular CSS or Sass. It should make use of buttons, alerts and colour-coding. Accessibility considerations should be made for non-standard users. Responsiveness and use of libraries such as Bootstrap, Foundation and Font Awesome is NOT required but is strongly encouraged.

More products