Skip to content

Commit

Permalink
Add existing class to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Knupp committed May 1, 2014
1 parent c146b2f commit 667bc0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 0 additions & 5 deletions sandman/model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
9 changes: 7 additions & 2 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)

0 comments on commit 667bc0b

Please sign in to comment.