Attachment 'models.py'

Download

   1 #----------------------------------------------------------------------------
   2 # Name:         models.py
   3 # Purpose:      Hold the application data
   4 #
   5 # Author:       Peter Damoc (peter at sigmacore.net)
   6 #               adapted from Martin Fowler's MVP example
   7 # Created:      January 2006
   8 # Version:      0.1 
   9 # Licence:      wxWindows license
  10 
  11 class Album(object):
  12     '''
  13     Just a dumb object that incapsulates the information of the album
  14     '''
  15     def __init__(self, artist, title, isClassical=False, composer=None):
  16         self.artist = artist
  17         self.title = title
  18         self.isClassical = isClassical
  19         self.composer = composer
  20 
  21 someAlbums = [
  22     ("Mike Oldfield", "The Songs of Distant Earth"),
  23     ("Loreena McKennitt", "The Visit"),
  24     ("Music Instructor", "Electric City"),
  25     ("Domingo, Plowright, Fassbaender, Zancanaro, Nesterenko", "Il Trovatore", True, "Giuseppe Verdi"),
  26     ("Riccardo Muti", "Rigoletto", True, "Giuseppe Verdi")
  27     ]
  28 
  29 def GetDemoAlbums():
  30     '''Just transforms a list of tuples containing data into a list of Albums using list comprehension'''
  31     return [Album(*data) for data in someAlbums]

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-04 09:16:02, 0.7 KB) [[attachment:albums.pyw]]
  • [get | view] (2009-10-04 09:16:02, 1.5 KB) [[attachment:interactors.py]]
  • [get | view] (2009-10-04 09:16:02, 2.3 KB) [[attachment:mock_objects.py]]
  • [get | view] (2009-10-04 09:16:02, 1.1 KB) [[attachment:models.py]]
  • [get | view] (2009-10-04 09:16:02, 12.4 KB) [[attachment:mvp.png]]
  • [get | view] (2009-10-04 09:16:02, 5.5 KB) [[attachment:mvp.zip]]
  • [get | view] (2009-10-04 09:16:02, 12.9 KB) [[attachment:mvp2.png]]
  • [get | view] (2009-10-04 09:16:02, 5.9 KB) [[attachment:mvp2.zip]]
  • [get | view] (2009-10-04 09:16:02, 3.8 KB) [[attachment:package.zip]]
  • [get | view] (2009-10-04 09:16:02, 4.4 KB) [[attachment:presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 2.2 KB) [[attachment:test_presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 4.3 KB) [[attachment:views.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.