1. @expose("json")
  2. def artists(self, action="view",artist_id=None):
  3. artists=session.query(model.Artist).all()
  4. return dict(artists=artists)
  5.  
  6. artists = self.artists()
  7.  
  8. # The _artists method can be used from any other method
  9. def _artists(self, action, artist_id):
  10. artists = session.query(model.Artist).all()
  11. return dict(artists=artists)
  12.  
  13. @expose("json")
  14. #@identity.require(identity.non_anonymous())
  15. # error handlers, etc.
  16. def artists(self, action="view", artist_id=None):
  17. return self._artists(action=action, artist_id=artist_id)