当前位置: 首页>>代码示例>>Python>>正文


Python ModuleSetting.set_for_module方法代码示例

本文整理汇总了Python中treeio.core.models.ModuleSetting.set_for_module方法的典型用法代码示例。如果您正苦于以下问题:Python ModuleSetting.set_for_module方法的具体用法?Python ModuleSetting.set_for_module怎么用?Python ModuleSetting.set_for_module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在treeio.core.models.ModuleSetting的用法示例。


在下文中一共展示了ModuleSetting.set_for_module方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
    def save(self):
        "Form processor"
        try:
            ModuleSetting.set_for_module('default_perspective',
                                         self.cleaned_data['default_perspective'].id,
                                         'treeio.core')
            ModuleSetting.set_for_module('default_permissions',
                                         self.cleaned_data['default_permissions'],
                                         'treeio.core')
            ModuleSetting.set_for_module('default_timezone',
                                         self.cleaned_data['default_timezone'],
                                         'treeio.core')
            ModuleSetting.set_for_module('language',
                                         self.cleaned_data['language'],
                                         'treeio.core')
            if getattr(settings, 'HARDTREE_SUBSCRIPTION_CUSTOMIZATION', True):
                if isinstance(self.fields['logo'], forms.FileField):
                    logopath = self._handle_uploaded_file('logo')
                    ModuleSetting.set_for_module('logopath', logopath, 'treeio.core')
                    
                elif isinstance(self.fields['logo'], forms.ChoiceField):
                    if self.cleaned_data['logo'] == 'delete':
                        try:
                            ModuleSetting.get_for_module('treeio.core', 'logopath').delete()
                        except:
                            pass
            
            return True

        except:
            return False
开发者ID:matalaniz,项目名称:treeio,代码行数:33,代码来源:forms.py

示例2: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
    def save(self):
        "Form processor"
        try:
            ModuleSetting.set_for_module(
                "default_perspective", self.cleaned_data["default_perspective"].id, "treeio.core"
            )
            ModuleSetting.set_for_module("default_permissions", self.cleaned_data["default_permissions"], "treeio.core")
            ModuleSetting.set_for_module("default_timezone", self.cleaned_data["default_timezone"], "treeio.core")
            ModuleSetting.set_for_module("language", self.cleaned_data["language"], "treeio.core")
            if getattr(settings, "HARDTREE_SUBSCRIPTION_CUSTOMIZATION", True):
                if isinstance(self.fields["logo"], forms.FileField):
                    logopath = self._handle_uploaded_file("logo")
                    ModuleSetting.set_for_module("logopath", logopath, "treeio.core")

                elif isinstance(self.fields["logo"], forms.ChoiceField):
                    if self.cleaned_data["logo"] == "delete":
                        try:
                            ModuleSetting.get_for_module("treeio.core", "logopath").delete()
                        except:
                            pass

            return True

        except:
            return False
开发者ID:nrazon,项目名称:treeio,代码行数:27,代码来源:forms.py

示例3: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
 def save(self):
     "Form processor"
     try:
         ModuleSetting.set_for_module('default_task_status',
                                      self.cleaned_data['default_task_status'].id,
                                      'treeio.projects')
         
     except Exception:
         return False
开发者ID:MechanisM,项目名称:treeio,代码行数:11,代码来源:forms.py

示例4: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
    def save(self):
        "Form processor"
        try:
            ModuleSetting.set_for_module(
                "default_item_status", self.cleaned_data["default_item_status"].id, "treeio.infrastructure"
            )

        except Exception:
            return False
开发者ID:ctburley,项目名称:treeio,代码行数:11,代码来源:forms.py

示例5: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
    def save(self):
        "Form processor"
        try:
            ModuleSetting.set_for_module('default_changeset_status',
                                         self.cleaned_data['default_changeset_status'].id,
                                         'treeio.changes')
            return True

        except Exception:
            return False
开发者ID:3atmospheres,项目名称:treeio,代码行数:12,代码来源:forms.py

示例6: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
    def save(self):
        "Form processor"
        try:
            ModuleSetting.set_for_module('default_ticket_status',
                                         self.cleaned_data['default_ticket_status'].id,
                                         'treeio.services')
            ModuleSetting.set_for_module('default_ticket_queue',
                                         self.cleaned_data['default_ticket_queue'].id,
                                         'treeio.services')
            ModuleSetting.set_for_module('send_email_to_caller',
                                         self.cleaned_data['send_email_to_caller'],
                                         'treeio.services')
            ModuleSetting.set_for_module('send_email_template',
                                         self.cleaned_data['send_email_template'],
                                         'treeio.services')
            return True

        except Exception:
            return False
开发者ID:korndorfer,项目名称:treeio,代码行数:21,代码来源:forms.py

示例7: save

# 需要导入模块: from treeio.core.models import ModuleSetting [as 别名]
# 或者: from treeio.core.models.ModuleSetting import set_for_module [as 别名]
 def save(self):
     "Form processor"
     try:
         ModuleSetting.set_for_module('default_contact_type',
                                      self.cleaned_data['default_contact_type'].id,
                                      'treeio.messaging')
     except:
         pass
     
     try:
         ModuleSetting.set_for_module('default_imap_folder',
                                      self.cleaned_data['default_imap_folder'],
                                      'treeio.messaging')
     except:
         pass
     
     try:
         ModuleSetting.set_for_module('signature',
                                      self.cleaned_data['signature'],
                                      'treeio.messaging', user=self.user)
     except:
         pass
开发者ID:jmfield2,项目名称:treeio,代码行数:24,代码来源:forms.py


注:本文中的treeio.core.models.ModuleSetting.set_for_module方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。