original_docstring: 
          Register a model as a setting, adding it to the wagtail admin menu
          
docstring: Register a model as a setting, adding it to the wagtail admin menu
docstring_tokens: Register a model as a setting adding it to the wagtail admin menu
code: def register(self, model, **kwargs):
          """
          Register a model as a setting, adding it to the wagtail admin menu
          """
  
          # Don't bother registering this if it is already registered
          if model in self:
              return model
          self.append(model)
  
          # Register a new menu item in the settings menu
          @hooks.register('register_settings_menu_item')
          def menu_hook():
              return SettingMenuItem(model, **kwargs)
  
          @hooks.register('register_permissions')
          def permissions_hook():
              return Permission.objects.filter(
                  content_type__app_label=model._meta.app_label,
                  codename='change_{}'.format(model._meta.model_name))
  
          return model
code_tokens: def register ( self , model , ** kwargs ) : if model in self : return model self . append ( model ) @ hooks . register ( 'register_settings_menu_item' ) def menu_hook ( ) : return SettingMenuItem ( model , ** kwargs ) @ hooks . register ( 'register_permissions' ) def permissions_hook ( ) : return Permission . objects . filter ( content_type__app_label = model . _meta . app_label , codename = 'change_{}' . format ( model . _meta . model_name ) ) return model
short_docstring: Register a model as a setting, adding it to the wagtail admin menu
short_docstring_tokens: Register a model as a setting adding it to the wagtail admin menu
comment: """
          Register a model as a setting, adding it to the wagtail admin menu
          """$SEP$# Don't bother registering this if it is already registered$SEP$# Register a new menu item in the settings menu