def __init__(self, model=None, path=None, actions=None):
        # set our model if passed in
        if model:
            self.model = model

        # derive our model name
        if not self.model_name:
            self.model_name = self.model._meta.object_name

        # derive our app name
        if not self.app_name:
            self.app_name = self.model._meta.app_label

        # derive our path from our class name
        if not path and not self.path:
            self.path = self.model_name.lower()

        # derive our module name from our class's module
        if not self.module_name:
            parts = self.__class__.__module__.split(".")
            self.module_name = parts[-2]

            # deal with special case of views subdirectories, we need to go up one more to find the real module
            if self.module_name == 'views' and len(parts) >= 3:
                self.module_name = parts[-3]

        # set our actions if set
        if actions:
            self.actions = actions
dataset/ETHPy150Open nyaruka/smartmin/smartmin/views.py/SmartCRUDL.__init__/original