Complete supervisor model and start improving forms
This commit is contained in:
+8
-3
@@ -33,6 +33,7 @@ class CidUserTable(tables.Table):
|
||||
#sba_exams = tables.ManyToManyColumn(verbose_name="SBA Exams")
|
||||
#longs_exams = tables.ManyToManyColumn(verbose_name="Long Exams")
|
||||
#anatomy_exams = tables.ManyToManyColumn(verbose_name="Anatomy Exams")
|
||||
group = tables.Column(linkify=True)
|
||||
|
||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||
|
||||
@@ -143,6 +144,8 @@ class UserUserTable(tables.Table):
|
||||
empty_values=(), linkify={"viewname": "account_update", "args":[A("username")]}, orderable=True, verbose_name="Edit",
|
||||
)
|
||||
|
||||
user_groups = tables.ManyToManyColumn(verbose_name="Groups", linkify_item=True)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
template_name = "django_tables2/bootstrap4.html"
|
||||
@@ -150,17 +153,19 @@ class UserUserTable(tables.Table):
|
||||
# "cid",
|
||||
#"userprofile",
|
||||
"userprofile.grade",
|
||||
#"user_groups",
|
||||
#"userprofile.supervisor",
|
||||
# "email",
|
||||
)
|
||||
sequence = ("user", "userprofile.grade", "supervisor", "edit")
|
||||
sequence = ("user", "userprofile.grade", "supervisor", "user_groups", "edit")
|
||||
|
||||
def __init__(self, data=None, *args, **kwargs):
|
||||
super().__init__(
|
||||
data.prefetch_related(
|
||||
"supervisor",
|
||||
"userprofile",
|
||||
#"userprofile.grade",
|
||||
"user_groups",
|
||||
"userprofile__grade",
|
||||
"supervisor",
|
||||
),
|
||||
*args,
|
||||
**kwargs,
|
||||
|
||||
Reference in New Issue
Block a user