===============================================
Data Model Layout (implemented with SQLAlchemy)
===============================================


NOTE: Knoboo is quickly moving away from using raw SQL (SQLite) 
to save state, and is instead going to use SQLAlchemy, which
provides a lot of benefits including:
    - Sophisticated data models without having to write SQL.
    - Allows different database to be used in the backed (SQLite, MySQL, PostgreSQL, etc)
    - Abstracts all database interaction as interactions with Python objects.
    - Probably more that we don't even know about yet :)


Notebook
========
 
Relation to Users
-----------------

One Notebook can have(=view, edit, delete) many Users.

    - User can 'view (=download)' => Anonymous user + Public Notebook

One User can have many Notebooks.


Relation to Access Permissions
------------------------------

One notebook can be 'Public' or 'Private'
    SQL => public?True:False (Boolean)


Relation to Deleting
--------------------

User Delete Notebook => Is User == 'created_by' OR User == 'admin'
    * All Cells must be deleted
    * All IndexedCells must be deleted.
    * All Data (Images, Text, etc) must be deleted



Cells
=====

    - type of cell (input, output, section, special? (@interact) )
    - keeps last modified date
    
Relation to Deleting
--------------------
    If the cell's parent notebook is deleted, it is deleted.




Bookshelf
=========

    -State? => Location of notebooks (All, Folder, Trash, Archive)

    -Uploaded data (text files, CSV files? )



Settings
========

Types of Settings
-----------------

    **per User**

    **per Notebook**
        -cell bordering


    **per Cell**
        -open/closed

    -Admin settings (global settings)

    -Access settings

    -Create new Account settings


