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