本文整理汇总了Python中tendenci.apps.user_groups.models.Group.allow_anonymous_view方法的典型用法代码示例。如果您正苦于以下问题:Python Group.allow_anonymous_view方法的具体用法?Python Group.allow_anonymous_view怎么用?Python Group.allow_anonymous_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tendenci.apps.user_groups.models.Group
的用法示例。
在下文中一共展示了Group.allow_anonymous_view方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_group_import
# 需要导入模块: from tendenci.apps.user_groups.models import Group [as 别名]
# 或者: from tendenci.apps.user_groups.models.Group import allow_anonymous_view [as 别名]
def do_group_import(group_object_dict):
"""Creates and Event and Place for the given event_object_dict
"""
group = Group()
# assure the correct fields get the right value types
for field in GROUP_FIELDS:
if field in group_object_dict:
field_type = Group._meta.get_field_by_name(field)[0]
if isinstance(field_type, FloatField):
setattr(group, field, group_object_dict[field])
else:
if field_type.max_length:
setattr(group, field, unicode(group_object_dict[field])[:field_type.max_length])
else:
setattr(group, field, unicode(group_object_dict[field]))
# Since the allow_anonymous_view is not included in the GROUP_FIELDS,
# set it to False
group.allow_anonymous_view = False
group.save()
return group