Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

11.2. Ordering List

A common pattern in many applications is the use of ordered collections. For instance, consider a simple to-do list application with multiple lists, each containing an (ordered) set of items. We might start with the following schema:

todo_list_table = Table(
    'todo_list', metadata,
    Column('name', Unicode(255), primary_key=True))

todo_item_table = Table(
    'todo_item', metadata,
    Column('id', Integer, primary_key=True),
    Column('list_name', None, ForeignKey('todo_list.name')),
    Column('list_position', Integer),
    Column('value', Unicode))


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint