本文整理匯總了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