Beispiel #1
0
 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')
Beispiel #2
0
 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')
Beispiel #3
0
 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')
Beispiel #4
0
 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')
Beispiel #5
0
    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')
Beispiel #6
0
 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')
Beispiel #7
0
    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')
Beispiel #8
0
 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)
Beispiel #9
0
 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)
Beispiel #10
0
    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')
Beispiel #11
0
    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')
Beispiel #12
0
    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')
Beispiel #13
0
    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')
Beispiel #14
0
 def list(self):
     c.pubs = meta.Session.query(model.Publication).all()
     return render('/publication/list.html')
Beispiel #15
0
 def new(self):
     return render('/publication/new.html')
Beispiel #16
0
 def music(self):
     c.soundclips = meta.Session.query(model.Soundclip).all()
     return render('/media/music.html')
Beispiel #17
0
 def index(self):
     return render('/friends/base.html')
Beispiel #18
0
 def list(self):
     c.works = meta.Session.query(model.Work).all()
     return render('/work/list.html')
Beispiel #19
0
 def index(self):
     return render('/contact/form.html')
Beispiel #20
0
 def checkout(self):
     return render('/catalog/checkout.html')
Beispiel #21
0
 def video(self):
     return render('/media/video.html')
Beispiel #22
0
 def index(self):
     c.composers = meta.Session.query(model.Composer).all()
     return render('/bios/list.html')
Beispiel #23
0
 def new(self):
     return render('/work/new.html')
Beispiel #24
0
 def index(self):
     return render('/news/base.html')
Beispiel #25
0
 def movementdetail(self,id):
     q = meta.Session.query(model.Movement).get(id)
     c.movement = q
     return render('/catalog/movementdetail.html')
Beispiel #26
0
 def index(self):
     return render('/media/base.html')
Beispiel #27
0
 def thanks(self):
     return render('/contact/thanks.html')
Beispiel #28
0
 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')
Beispiel #29
0
 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')
Beispiel #30
0
 def index(self):
     return render('/services/base.html')