示例#1
0
class EntryAdminTable(EntryTable):
    edit = Column.edit()
    delete = Column.delete()

    class Meta:
        actions = dict(
            create=Action.button(tag='a', attrs__href='create'),
            logout=Action.button(tag='a', attrs__href='/logout/'),
        )
示例#2
0
 class Meta:
     auto__model = Album
     page_size = 20
     columns__name__cell__url = lambda row, **_: row.get_absolute_url()
     columns__name__filter__include = True
     columns__year__filter__include = True
     columns__year__filter__field__include = False
     columns__artist__filter__include = True
     columns__edit = Column.edit(
         include=lambda request, **_: request.user.is_staff,
     )
     columns__delete = Column.delete(
         include=lambda request, **_: request.user.is_staff,
     )
     actions__create_album = Action(attrs__href='/albums/create/',
                                    display_name=_('Create album'))