Compare commits
2 commits
e789201942
...
f08c823dc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f08c823dc1 | ||
|
|
ab7b466ce4 |
3 changed files with 99 additions and 15 deletions
18
README.md
18
README.md
|
|
@ -15,11 +15,10 @@ A simple SQLite-based system for managing tablet lending and returns.
|
||||||
|
|
||||||
## Files
|
## Files
|
||||||
|
|
||||||
- `minimal_app.py` - Interactive command-line application (includes non-loanable device management)
|
- `minimal_app.py` - **DEPRECATED** - Interactive command-line application (limited functionality, use `app.py` instead)
|
||||||
- `test_app.py` - Test script that demonstrates functionality
|
- `test_app.py` - Test script that demonstrates functionality
|
||||||
- `tablets.db` - SQLite database (created automatically, includes non_loanable_devices table)
|
- `tablets.db` - SQLite database (created automatically, includes non_loanable_devices table)
|
||||||
- `simple_app.py` - Web-based version (requires Flask, includes non-loanable device management)
|
- `app.py` - **Recommended** - Full-featured web version (requires Flask, includes all features)
|
||||||
- `app.py` - Alternative web version (requires Flask, includes non-loanable device management)
|
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
|
|
@ -35,18 +34,21 @@ This will:
|
||||||
- Demonstrate loan and return operations
|
- Demonstrate loan and return operations
|
||||||
- Show the complete workflow
|
- Show the complete workflow
|
||||||
|
|
||||||
### 2. Run the interactive application
|
### 2. Run the web application (Recommended)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 minimal_app.py
|
python3 app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
This provides a menu-driven interface for:
|
This provides a full-featured web interface for:
|
||||||
- Adding tablets
|
- Adding tablets (with notes field)
|
||||||
- Adding users
|
- Adding users (with email and phone)
|
||||||
- Loaning tablets
|
- Loaning tablets
|
||||||
- Returning tablets
|
- Returning tablets
|
||||||
- Viewing inventory and loan status
|
- Viewing inventory and loan status
|
||||||
|
- User loans view with search
|
||||||
|
- Non-loanable devices management
|
||||||
|
- Project management with markdown notes
|
||||||
|
|
||||||
### 3. Database Structure
|
### 3. Database Structure
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,28 @@
|
||||||
# CLI vs Web Functionality Comparison
|
# CLI vs Web Functionality Comparison
|
||||||
|
|
||||||
|
## ⚠️ DEPRECATION NOTICE
|
||||||
|
|
||||||
|
**The CLI version (`minimal_app.py`) is now DEPRECATED.**
|
||||||
|
|
||||||
|
Please use the **web interface (`app.py`)** for all operations. The web interface provides:
|
||||||
|
- Complete feature set
|
||||||
|
- Full database schema support
|
||||||
|
- Responsive mobile interface
|
||||||
|
- Better user experience
|
||||||
|
|
||||||
|
The CLI will be removed in a future version. This document is kept for historical reference.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This document compares the functionality between the **CLI version** (`minimal_app.py`) and the **Web version** (`app.py`) of the Tablet Management System.
|
This document compares the functionality between the **DEPRECATED CLI version** (`minimal_app.py`) and the **Web version** (`app.py`) of the Tablet Management System.
|
||||||
|
|
||||||
## Current State
|
## Current State
|
||||||
|
|
||||||
### Web Version (app.py) - Complete Feature Set
|
### Web Version (app.py) - ✅ RECOMMENDED
|
||||||
|
|
||||||
|
The web version is the **primary and recommended** interface for all users.
|
||||||
|
|
||||||
| Feature | Status | Route | Template |
|
| Feature | Status | Route | Template |
|
||||||
|---------|--------|-------|---------|
|
|---------|--------|-------|---------|
|
||||||
|
|
@ -24,11 +40,15 @@ This document compares the functionality between the **CLI version** (`minimal_a
|
||||||
| Delete Non-Loanable Device | ✅ | `/delete_non_loanable_device/<id>` | N/A (redirects) |
|
| Delete Non-Loanable Device | ✅ | `/delete_non_loanable_device/<id>` | N/A (redirects) |
|
||||||
| Project Management | ✅ | `/project_management` | `project_management.html` |
|
| Project Management | ✅ | `/project_management` | `project_management.html` |
|
||||||
|
|
||||||
### CLI Version (minimal_app.py) - Incomplete
|
### CLI Version (minimal_app.py) - ❌ DEPRECATED
|
||||||
|
|
||||||
|
**This CLI is deprecated and should not be used for new development.**
|
||||||
|
|
||||||
|
The CLI has limited functionality and does not support all database columns used by the web version.
|
||||||
|
|
||||||
| Feature | Status | Function |
|
| Feature | Status | Function |
|
||||||
|---------|--------|----------|
|
|---------|--------|----------|
|
||||||
| Add Tablet | ✅ | `add_tablet()` |
|
| Add Tablet | ⚠️ Partial | `add_tablet()` - Missing notes field |
|
||||||
| Add User | ⚠️ Partial | `add_user()` - Missing email/phone |
|
| Add User | ⚠️ Partial | `add_user()` - Missing email/phone |
|
||||||
| Loan Tablet | ✅ | `loan_tablet()` |
|
| Loan Tablet | ✅ | `loan_tablet()` |
|
||||||
| Return Tablet | ✅ | `return_tablet()` |
|
| Return Tablet | ✅ | `return_tablet()` |
|
||||||
|
|
@ -43,6 +63,45 @@ This document compares the functionality between the **CLI version** (`minimal_a
|
||||||
| **Edit Non-Loanable Device** | ❌ Missing | N/A |
|
| **Edit Non-Loanable Device** | ❌ Missing | N/A |
|
||||||
| **Project Management** | ❌ Missing | N/A |
|
| **Project Management** | ❌ Missing | N/A |
|
||||||
|
|
||||||
|
## Migration Path
|
||||||
|
|
||||||
|
### For Existing CLI Users
|
||||||
|
|
||||||
|
**Stop using the CLI and switch to the web interface:**
|
||||||
|
|
||||||
|
1. Run the web interface:
|
||||||
|
```bash
|
||||||
|
python3 app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Open your browser to: http://localhost:5000
|
||||||
|
|
||||||
|
3. The web interface uses the **same database** (`tablets.db`), so all your data is preserved.
|
||||||
|
|
||||||
|
### Database Compatibility
|
||||||
|
|
||||||
|
The CLI's database schema is **missing some columns** that the web version uses:
|
||||||
|
- `tablets.notes` - Added by web version
|
||||||
|
- `users.email` - Added by web version
|
||||||
|
- `users.phone` - Added by web version
|
||||||
|
|
||||||
|
**If you've only used the CLI:** Your database is missing these columns. The web interface will still work, but won't be able to store notes, email, or phone until the columns are added.
|
||||||
|
|
||||||
|
**To fix the database schema:**
|
||||||
|
```bash
|
||||||
|
# Run the web interface - it will add missing columns automatically
|
||||||
|
python3 app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The web version's `init_db()` will add any missing columns when it runs.
|
||||||
|
|
||||||
|
## Recommendation
|
||||||
|
|
||||||
|
**Use `app.py` (web interface) for all operations.**
|
||||||
|
|
||||||
|
The CLI (`minimal_app.py`) is deprecated and will be removed in a future version. All development and maintenance efforts should focus on the web interface.
|
||||||
|
|
||||||
|
|
||||||
## Missing Features in CLI
|
## Missing Features in CLI
|
||||||
|
|
||||||
### 1. User Management
|
### 1. User Management
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,23 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Minimal Tablet Lending and Return Management System
|
DEPRECATED - Tablet Lending and Return Management System (CLI)
|
||||||
Using only built-in Python modules
|
|
||||||
|
This CLI version is DEPRECATED. Please use the web interface instead.
|
||||||
|
|
||||||
|
The web interface (app.py) provides full functionality including:
|
||||||
|
- Complete user management (name, email, phone, identification)
|
||||||
|
- Full tablet management with notes field
|
||||||
|
- User loans view with search
|
||||||
|
- Edit functionality for non-loanable devices
|
||||||
|
- Project management
|
||||||
|
- Responsive mobile interface
|
||||||
|
|
||||||
|
To run the web interface:
|
||||||
|
python3 app.py
|
||||||
|
|
||||||
|
Then open http://localhost:5000 in your browser.
|
||||||
|
|
||||||
|
This CLI will be removed in a future version.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
@ -273,10 +289,17 @@ def delete_non_loanable_device(device_id):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main menu"""
|
"""Main menu"""
|
||||||
|
print("=" * 70)
|
||||||
|
print("DEPRECATION WARNING: This CLI is deprecated!")
|
||||||
|
print("Please use the web interface instead: python3 app.py")
|
||||||
|
print("=" * 70)
|
||||||
|
print()
|
||||||
|
|
||||||
init_db()
|
init_db()
|
||||||
|
|
||||||
print("=== Tablet Lending and Return Management System ===")
|
print("=== Tablet Lending and Return Management System (DEPRECATED) ===")
|
||||||
print("Using SQLite database: tablets.db")
|
print("Using SQLite database: tablets.db")
|
||||||
|
print("NOTE: This CLI has limited functionality. Use web interface for full features.")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
print("\nMenu:")
|
print("\nMenu:")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue