Package Camelot :: Package camelot :: Package admin :: Module not_editable_admin
[frames] | no frames]

Module not_editable_admin

source code

Class decorator to make all fields visualized with the Admin into read-only fields
Functions
 
notEditableAdmin(original_admin, actions=False, editable_fields=None)
Turn all fields visualized with original_admin into read only fields :param original_admin: an implementation of ObjectAdmin :param actions: True if the notEditableAdmin should have its actions enabled, default to False :param editable_fields: list of fields that should remain editable
source code
Variables
  __package__ = 'Camelot.camelot.admin'
Function Details

notEditableAdmin(original_admin, actions=False, editable_fields=None)

source code 

Turn all fields visualized with original_admin into read only fields :param original_admin: an implementation of ObjectAdmin :param actions: True if the notEditableAdmin should have its actions enabled, default to False :param editable_fields: list of fields that should remain editable

usage

class Movie(Entity):
  name = Field(Unicode(50))
  contributions = Field(Unicode(255))

  class Admin(EntityAdmin):
    list_display = ['name', 'contributions]

  Admin = notEditableAdmin(Admin, editable_fields=['contributions'])