Fullstack Fruit & Veg Shop: A web application developed with HTML, CSS, and JavaScript for the frontend, and Django for the backend. Features include user authentication, a product catalogue, shopping cart functionality, and order management. and much more
Add Proxy Models for User Types and Test for Database Tables
Added Test for Custom Models
Introduced a test called test_creation_count to verify that the database contains the expected number of tables.
Custom Model Types
The following proxy models extend the existing User model without altering the database schema. They provide a structured way to manage different user types with custom logic and do not create new database tables; they simply reference the existing schema.
Created AdminSuperUserProxy to manage superusers in the Django admin interface.
Created AdminStaffUserProxy to manage staff/admin users in the Django admin interface.
Created AdminUserProxy to manage admin users in the Django admin interface.
Defined proxy models SuperUserProxy and StaffUserProxy for the above admin classes.
Created VerifiedUserProxy to represent verified users with specific behaviour.
Created BannedUserProxy to handle banned users with custom functionality.
Created ActiveUserProxy to manage active users with custom functionality.
Created NonActiveUserProxy to manage non-active users with custom functionality.
How to Use in the Admin Interface
Superusers Admin Interface:
Navigate to the Django admin site.
Under the "Users" section, find "Superusers" to display only users with superuser privileges.
Admin Users Admin Interface:
Under the "Users" section, find "Admin Users" to display only users with admin status.
Staff Users Admin Interface:
Under the "Users" section, find "Staff Users" to display only users with staff status.
Verified Users Admin Interface:
Under the "Users" section, find "Verified Users" to display only users who have verified their email.
Banned Users Admin Interface:
Under the "Users" section, find "Banned Users" to display only users who have been banned.
Active Users Admin Interface:
Under the "Users" section, find "Active Users" to display only users who are currently active.
Non-Active Users Admin Interface:
Under the "Users" section, find "Non-Active Users" to display only users who are no longer active.
These goal is to enhance user management by providing more granular control in the admin interface, allowing for easier navigation and filtering by user type.
Add Proxy Models for User Types and Test for Database Tables
Added Test for Custom Models
test_creation_count
to verify that the database contains the expected number of tables.Custom Model Types
The following proxy models extend the existing User model without altering the database schema. They provide a structured way to manage different user types with custom logic and do not create new database tables; they simply reference the existing schema.
AdminSuperUserProxy
to manage superusers in the Django admin interface.AdminStaffUserProxy
to manage staff/admin users in the Django admin interface.AdminUserProxy
to manage admin users in the Django admin interface.SuperUserProxy
andStaffUserProxy
for the above admin classes.VerifiedUserProxy
to represent verified users with specific behaviour.BannedUserProxy
to handle banned users with custom functionality.ActiveUserProxy
to manage active users with custom functionality.NonActiveUserProxy
to manage non-active users with custom functionality.How to Use in the Admin Interface
Superusers Admin Interface:
Admin Users Admin Interface:
Staff Users Admin Interface:
Verified Users Admin Interface:
Banned Users Admin Interface:
Active Users Admin Interface:
Non-Active Users Admin Interface:
These goal is to enhance user management by providing more granular control in the admin interface, allowing for easier navigation and filtering by user type.