示例#1
0
def update_objects_permissions():
    """ update all the contents permissions """
    models = BaseContent.get_subclasses()
    for model in models:
        print 'Updating model: %s' % model
        queryset = model.objects.all()
        update_queryset_permissions(queryset)
示例#2
0
 def queryset(self, request, basecontent=None):
     # Ugly hack to quickly extract non related content types
     if request.GET.get('id__isnull', None) == 'false':
         return ContentType.objects.exclude(workflowmodelrelation__workflow=self.basecontent)
     else:
         models = [BaseContent] + BaseContent.get_subclasses()
         return ContentType.objects.filter(model__in=[model._meta.module_name
                                                      for model in models])
示例#3
0
 def queryset(self, request, basecontent=None):
     # Ugly hack to quickly extract non related content types
     if request.GET.get('id__isnull', None) == 'false':
         return ContentType.objects.exclude(
             workflowmodelrelation__workflow=self.basecontent)
     else:
         models = [BaseContent] + BaseContent.get_subclasses()
         return ContentType.objects.filter(
             model__in=[model._meta.module_name for model in models])