This is a simple library management system built for Major Project 2021 by Abhik Bhattacharya (id : 181001102058) & Saikat Shee (id : 181001102053 )
This project is built with :
- see all the books in homepage
- search books based on author or name of the book or category of the book
- sort books or author alphabetically
-
login / signup ,
-
can request book
-
see their own issues and filter them based on :
- requested issues ,
- issued books or
- all of them together
-
check their own fines
-
can see
- the days remaining to return a particular book or
- the number of days passed the return date of a particular book in the my fines page
-
Pay their fines online (powered by RazorPay)
-
login to admin dashboard
-
check all issues :
-
see issues ,
-
delete issues ,
-
search issues by studentid
-
filter issues based on :
- issued or not,
- returned or not ,
-
-
accept a issue :
- from the dashboard where admin has to manually select return date or
- from the Issue requests page where return date is automatically calculated
-
add , delete search books and filter books based on author
-
add , delete , search author
-
calculate fine by clicking a button ,
-
create, delete fine ,search fines for studentid
-
toggle fine paid status (if paid in cash)
-
search ,modify,add,delete students , filter them based on department and check all fines and issues of that student
-
can see the last-login , date joined & the student associated to a particular user
-
can change password for any user
- while signing up if studentID is already associated to a user in this platform then it will show a error without reloading the page and as soon as correct id is given then the error will go away
- Books in homepage will show status of
issued
,issue requested
orrequest issue
based on whether the book is issued or requested for a issue or is not requested for logged-in students only
We need this for writing our authentication views as well as student & department models. Student model has the first+last name ,department foreignkey and studentID which is one-to-one field to Django' User model. We use Django's User Model for authentication . There will be 3 views: login,signup and logout. The urls will have /student/< login or signup or logout >/
.
This is our main app where we will write our library system's main logic. It comprises of 4 models:
- Author - for storing name & description of author
- Book - for storing name , image ,category of a book & connecting to the author
- Issue - for tracking each & every issue a student requests. It will also track the book for which issue is requested , issue status (whether issued or not) , return status (whether returned or not) , return date (last date to return the book) and more...
- Fine - for tracking the fines & calculating fines automatically for each student whose issued book/s is/are not returned and the last date is passed
Student ID - Username of Django's User Model serves as our studentID
Signing Up - so every student who signs up creates a new user instance with his/her student id as the username and then a student instance is also created with the names and department and this user we just created.
Calculating Fine - How ?? - We run a for loop and pass all the issues to this calculate fine function. Then:
-
for each issue , check whether the issue is issued or not (if issue is not issued then no need to calculate fines)
-
if issue is issued then check whether issue is returned or not (if issue is returned then no need to calculate fines)
- if issue is not returned then check whether the issue's return date is passed or not (if not passed then no calculation of fines is needed)
- create or get a fine instance with student & issue then calculate the amount and save it to the amount field
- if issue is not returned then check whether the issue's return date is passed or not (if not passed then no calculation of fines is needed)
-
Calculating Fine - When ?? -
- Whenever admin clicks on "Calculate Fine" button
- Whenever a student opens his "My Fines" page
Payment of Fines
- when a student clicks on pay button (in myfines page)
- we create a razorpay order with a dict containing fine amount (coverted to int and multiplied by 100 because razorpay wants in paisa) , order_id, currency
- then we send the user to the payfines page (payfines.html) with the amount (in paisa ) , razorpay key id, razorpay order id & amount (which should be displayed)
- user chooses proceed to payment online , selects paymode (Netbanking , Card , Wallet etc.) and pays the amount
- we verify the payment status whether success or failure
- then payment is (successfull/failure) message is shown on myfine page with (paid status / pay button) beside that fine