Open benlapointe opened 3 years ago
git clone https://github.com/MKotlik/BeMyReader.git git checkout -b iss2_browse_list
Terminal 1:
cd BeMyReader python -m venv venv source venv/bin/activate pip install django (maybe not needed?) pip install twilio (maybe not needed?) cd (into directory) python manage.py migrate (maybe not needed?) python manage.py runserver
Terminal 2: ngrok http 8000
[ ] If we can return number of rows from SQLite database, then we can check which content selections are valid
python manage.py shell from browse.models import Content all_entries = Content.objects.all() len(all_entries.values())
[ ] How can we easily delete/add/manage entries of SQLite database?
[ ] Update browse_content() to take entry from user, then act on that entry in the correct way.
all_entries.values('id','digits') <QuerySet [{'id': 1, 'digits': 1}, {'id': 2, 'digits': 2}, {'id': 3, 'digits': 3}, {'id': 4, 'digits': 4}]>
Delete entry and view result
all_entries.filter(id=2).delete() all_entries.values('id') <QuerySet [{'id': 1}, {'id': 3}, {'id': 4}]>
How to delete database file and start from scratch: https://stackoverflow.com/questions/42150499/how-do-i-delete-db-sqlite3-in-django-1-9-to-start-from-scratch/42150639
Modify an entry:
e = all_entries.get(id=1) e.head = "Entry 1" e.save()
The basic browsing list interface will look like this: