X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/ae776bf293241715725ceaf45a5293d0de0e63d1..04677c432f0c579e2ef79e80c1c14d7f1d33369a:/sercom/subcontrollers/enunciado/__init__.py diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index d2897a5..f8b045c 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -69,13 +69,15 @@ class EnunciadoController(controllers.Controller, identity.SecureResource): raise redirect('list') @expose(template='kid:%s.templates.list' % __name__) - @validate(validators=dict(autorID=validators.Int)) + @validate(validators=dict(autor=validators.Int)) @paginate('records') - def list(self, **kw): + def list(self, autor=None, tg_flash=None): """List records in model""" - f = kw.get('tg_flash', None) - r = cls.select() - return dict(records=r, name=name, namepl=namepl, tg_flash=f) + if autor is None: + r = cls.select() + else: + r = cls.selectBy(autorID=autor) + return dict(records=r, name=name, namepl=namepl, tg_flash=tg_flash) @expose(template='kid:%s.templates.new' % __name__) def new(self, **kw):