publish page items for superuser
This commit is contained in:
parent
c08b11f5ee
commit
aa3701865e
|
@ -252,6 +252,9 @@ 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()
|
||||||
|
if user.is_superuser:
|
||||||
|
return qset
|
||||||
|
else:
|
||||||
return qset.filter(Q(owner=user) | Q(users=user))
|
return qset.filter(Q(owner=user) | Q(users=user))
|
||||||
|
|
||||||
# for q in qset:
|
# for q in qset:
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user