publish page items for superuser

This commit is contained in:
Sanj 2011-10-20 16:41:34 +01:00
parent c08b11f5ee
commit aa3701865e
2 changed files with 5 additions and 1 deletions

View File

@ -252,7 +252,10 @@ class Article(models.Model):
def get_can_edit_list(kls, user, qset=False): def get_can_edit_list(kls, user, qset=False):
if not qset: if not qset:
qset = kls.objects.all() qset = kls.objects.all()
return qset.filter(Q(owner=user) | Q(users=user)) if user.is_superuser:
return qset
else:
return qset.filter(Q(owner=user) | Q(users=user))
# for q in qset: # for q in qset:

View File

@ -232,6 +232,7 @@ class File(models.Model):
class Category(models.Model): class Category(models.Model):
name = models.CharField(max_length=255) name = models.CharField(max_length=255)
groups = models.ManyToManyField(Group, null=True) groups = models.ManyToManyField(Group, null=True)
# descriotion = models.TextField(blank=True)
# folder_name = models.CharField(max_length=512) # folder_name = models.CharField(max_length=512)
def __unicode__(self): def __unicode__(self):