From 667bc0be1f6b12e322fa1d94fee3987664317497 Mon Sep 17 00:00:00 2001 From: Jeff Knupp Date: Thu, 1 May 2014 14:42:33 -0400 Subject: [PATCH] Add existing class to test --- sandman/model/models.py | 5 ----- tests/models.py | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sandman/model/models.py b/sandman/model/models.py index cb68493..7c8cc89 100644 --- a/sandman/model/models.py +++ b/sandman/model/models.py @@ -174,8 +174,3 @@ def __str__(self): class AdminModelViewWithPK(ModelView): """Mixin admin view class that displays primary keys on the admin form""" column_display_pk = True - -class AuthenticatedAdminModelView(ModelView): - - def is_accessible(self): - raise NotImplementedError('You must implement the \'is_accessible\' method to use authorization.') diff --git a/tests/models.py b/tests/models.py index 649f573..f85ed0e 100644 --- a/tests/models.py +++ b/tests/models.py @@ -2,10 +2,16 @@ from flask.ext.admin.contrib.sqla import ModelView from sandman.model import register, Model, activate +from sandman.model.models import db class ArtistAdminView(ModelView): pass +class SomeModel(db.Model): + __tablename__ = 'some_model' + id = db.Column(db.Integer, primary_key=True) + value = db.Column(db.String) + class Artist(Model): """Model mapped to the "Artist" table""" __tablename__ = 'Artist' @@ -89,6 +95,5 @@ def validate_GET(resource=None): return False return True -register((Artist, Album, Playlist, Track, MediaType)) -register(Style) +register((Artist, Album, Playlist, Track, MediaType, Style, SomeModel)) activate(browser=True)