Exemplo n.º 1
0
 def __init__(self, entity, admin=None, verbose_name=None, parent_admin=None):
     from camelot.admin.application_admin import get_application_admin
     self.parent_admin = parent_admin or get_application_admin()
     if admin:
         self.admin = admin(self.parent_admin, entity)
     else:
         self.admin = self.parent_admin.get_entity_admin(entity)
     self.entity = entity
     self.verbose_name = verbose_name
Exemplo n.º 2
0
 def __init__(self,
              entity,
              admin=None,
              verbose_name=None,
              parent_admin=None):
     from camelot.admin.application_admin import get_application_admin
     self.parent_admin = parent_admin or get_application_admin()
     if admin:
         self.admin = admin(self.parent_admin, entity)
     else:
         self.admin = self.parent_admin.get_entity_admin(entity)
     self.entity = entity
     self.verbose_name = verbose_name
Exemplo n.º 3
0
 def __init__( self, app_admin, entity ):
     """
     :param app_admin: the application admin object for this application, 
         if None, then the default application_admin is taken
     :param entity: the entity class for which this admin instance is to be
         used
     """
     if not app_admin:
         from camelot.admin.application_admin import get_application_admin
         self.app_admin = get_application_admin()
     else:
         self.app_admin = app_admin
     if entity:
         self.entity = entity
     #
     # caches to prevent recalculation of things
     #
     self._field_attributes = dict()
     self._subclasses = None
Exemplo n.º 4
0
 def __init__( self, app_admin, entity ):
     """
     :param app_admin: the application admin object for this application, 
         if None, then the default application_admin is taken
     :param entity: the entity class for which this admin instance is to be
         used
     """
     if not app_admin:
         from camelot.admin.application_admin import get_application_admin
         self.app_admin = get_application_admin()
     else:
         self.app_admin = app_admin
     if entity:
         self.entity = entity
     #
     # caches to prevent recalculation of things
     #
     self._field_attributes = dict()
     self._subclasses = None
Exemplo n.º 5
0
    def __init__(self, app_admin, entity):
        """

        :param app_admin: the application admin object for this application, if None,
        then the default application_admin is taken
        :param entity: the entity class for which this admin instance is to be
        used
        """
        from camelot.view.remote_signals import get_signal_handler
        if not app_admin:
            from camelot.admin.application_admin import get_application_admin
            self.app_admin = get_application_admin()
        else:
            self.app_admin = app_admin
        self.rsh = get_signal_handler()
        if entity:
            from camelot.view.model_thread import get_model_thread
            self.entity = entity
            self.mt = get_model_thread()
        #
        # caches to prevent recalculation of things
        #
        self._field_attributes = dict()
        self._subclasses = None
Exemplo n.º 6
0
    def __init__(self, app_admin, entity):
        """

        :param app_admin: the application admin object for this application, if None,
        then the default application_admin is taken
        :param entity: the entity class for which this admin instance is to be
        used
        """
        from camelot.view.remote_signals import get_signal_handler
        if not app_admin:
            from camelot.admin.application_admin import get_application_admin
            self.app_admin = get_application_admin()
        else:
            self.app_admin = app_admin
        self.rsh = get_signal_handler()
        if entity:
            from camelot.view.model_thread import get_model_thread
            self.entity = entity
            self.mt = get_model_thread()
        #
        # caches to prevent recalculation of things
        #
        self._field_attributes = dict()
        self._subclasses = None
Exemplo n.º 7
0
 def get_admin(self):
     from camelot.admin.application_admin import get_application_admin
     app_admin = get_application_admin()
     if self.Admin:
         return self.Admin(app_admin, self.Data)
     return app_admin.get_entity_admin(self.Data)