def view(self, id): c.heading = 'heya..' pub_q = model.meta.Session.query(model.Publication) c.pub = pub_q.get(int(id)) if c.pub is None: abort(404) return render('/publication/view.html')
def view(self, id): c.heading = 'work details' work_q = model.meta.Session.query(model.Work) c.work = work_q.get(int(id)) if c.work is None: abort(404) return render('/work/view.html')
def view(self,id): c.composer = meta.Session.query(model.Composer).get(id) c.bio = textile(c.composer.bio) c.numworks = len(c.composer.works) c.numpublications = len(c.composer.publications) c.featured_works = [w for w in c.composer.works if w.featured == True] c.featured_publications = [w for w in c.composer.publications if w.featured == True] return render('/bios/detail.html')
def view(self,id): c.artist = meta.Session.query(model.Artist).get(id) if c.artist.bio: c.bio = textile(c.artist.bio) #meta.Session.query(model.Album).filter(model.Album.artists.contains(c.artist)).all() #c.numworks = len(q.all()) #c.featured = q.filter_by(featured=True).all() return render('/artist/detail.html')
def list(self,id): key = meta.Session.query(model.Key).get(id) c.cat = key c.works = meta.Session.query(model.Work).filter_by(key=key) c.movements = meta.Session.query(model.Movement).filter_by(key=key) #c.works = works.filter(model.Work.key.contains(style)).all() c.info = 'Viewing by Key: %s'%key.name return render('/catalog/combinedlist.html')
def list(self,id): composer = meta.Session.query(model.Composer).get(id) c.composer = composer #works = meta.Session.query(model.Work) #c.works = works.filter_by(composer=composer).order_by(model.Work.title).all() #c.works = works.filter_by(composer=composer).all() #c.movements = works.filter_by(composer=composer).all() from sqlalchemy import or_, and_, desc, asc c.publications = meta.Session.query(model.Publication).filter(model.Publication.composers.contains(composer)).order_by(model.Publication.catalog_number) return render('/catalog/composerlist.html')
def list(self,id): style = meta.Session.query(model.Style).get(id) works = meta.Session.query(model.Work) c.cat = style c.works = works.filter(model.Work.styles.contains(style)).order_by(model.Work.title) c.info = 'Viewing Publications with Style: %s'%style.name c.publications = meta.Session.query(model.Publication).filter(model.Publication.styles.contains(style)).order_by(model.Publication.catalog_number) return render('/catalog/list.html')
def edit(self, id=None): if id is None: abort(404) pub_q = meta.Session.query(model.Publication) pub = pub_q.filter_by(id=id).first() if pub is None: abort(404) values = { 'title': pub.title, 'description': pub.description } return htmlfill.render(render('/publication/edit.html'), values)
def edit(self, id=None): if id is None: abort(404) work_q = meta.Session.query(model.Work) work = work_q.filter_by(id=id).first() if work is None: abort(404) values = { 'title': work.title, 'description': work.description } return htmlfill.render(render('/work/edit.html'), values)
def by_style(self): c.categories = meta.Session.query(model.Style).order_by(model.Style.name) c.type = 'Style' c.controller = 'style' publications = meta.Session.query(model.Publication) c.numincat = [] for n,style in enumerate(c.categories): c.numincat.append( publications.filter(model.Publication.styles.contains(style)).count() ) #c.numincat.append( n ) return render('/catalog/category.html')
def by_key(self): q = meta.Session.query(model.Key) c.categories = q.order_by(model.Key.name) c.type = 'Key' c.controller = 'key' works = meta.Session.query(model.Work) movements = meta.Session.query(model.Movement) c.numincat = [] for n,key in enumerate(c.categories): c.numincat.append( len( works.filter_by(key=key).all() ) + len( movements.filter_by(key=key).all() ) ) return render('/catalog/category.html')
def by_composer(self): q = meta.Session.query(model.Composer) c.categories = q.all() c.type = 'Composer' c.controller = 'composer' works = meta.Session.query(model.Work) publications = meta.Session.query(model.Publication) c.numincat = [] for n,composer in enumerate(c.categories): c.numincat.append( publications.filter(model.Publication.composers.contains(composer)).count() ) return render('/catalog/category.html')
def by_instrument(self): q = meta.Session.query(model.Instrument) c.categories = q.order_by(model.Instrument.name) c.type = 'Instrument' c.controller = 'instrument' works = meta.Session.query(model.Work) c.numincat = [] for n,instrument in enumerate(c.categories): c.numincat.append( len( works.filter(model.Work.instruments.contains(instrument)).all() ) ) #c.numincat.append( n ) return render('/catalog/category.html')
def list(self): c.pubs = meta.Session.query(model.Publication).all() return render('/publication/list.html')
def new(self): return render('/publication/new.html')
def music(self): c.soundclips = meta.Session.query(model.Soundclip).all() return render('/media/music.html')
def index(self): return render('/friends/base.html')
def list(self): c.works = meta.Session.query(model.Work).all() return render('/work/list.html')
def index(self): return render('/contact/form.html')
def checkout(self): return render('/catalog/checkout.html')
def video(self): return render('/media/video.html')
def index(self): c.composers = meta.Session.query(model.Composer).all() return render('/bios/list.html')
def new(self): return render('/work/new.html')
def index(self): return render('/news/base.html')
def movementdetail(self,id): q = meta.Session.query(model.Movement).get(id) c.movement = q return render('/catalog/movementdetail.html')
def index(self): return render('/media/base.html')
def thanks(self): return render('/contact/thanks.html')
def workdetail(self,id): q = meta.Session.query(model.Work).get(id) c.work = q if c.work.description: c.work.description = textile(c.work.description) return render('/catalog/workdetail.html')
def publicationdetail(self,id): c.publication = meta.Session.query(model.Publication).get(id) if c.publication.description: c.publication.description = textile(c.publication.description) return render('/catalog/publicationdetail.html')
def index(self): return render('/services/base.html')