Proper docstrings in forms
This commit is contained in:
parent
d9a0460942
commit
675210586c
1 changed files with 10 additions and 7 deletions
|
@ -6,9 +6,10 @@ from django.contrib.auth import get_user_model
|
|||
|
||||
|
||||
class AddTaskListForm(ModelForm):
|
||||
# The picklist showing allowable groups to which a new list can be added
|
||||
# determines which groups the user belongs to. This queries the form object
|
||||
# to derive that list.
|
||||
"""The picklist showing allowable groups to which a new list can be added
|
||||
determines which groups the user belongs to. This queries the form object
|
||||
to derive that list."""
|
||||
|
||||
def __init__(self, user, *args, **kwargs):
|
||||
super(AddTaskListForm, self).__init__(*args, **kwargs)
|
||||
self.fields['group'].queryset = Group.objects.filter(user=user)
|
||||
|
@ -19,8 +20,9 @@ class AddTaskListForm(ModelForm):
|
|||
|
||||
|
||||
class AddItemForm(ModelForm):
|
||||
# The picklist showing the users to which a new task can be assigned
|
||||
# must find other members of the groups the current list belongs to.
|
||||
"""The picklist showing the users to which a new task can be assigned
|
||||
must find other members of the groups the current list belongs to."""
|
||||
|
||||
def __init__(self, task_list, *args, **kwargs):
|
||||
super(AddItemForm, self).__init__(*args, **kwargs)
|
||||
# debug:
|
||||
|
@ -45,8 +47,9 @@ class AddItemForm(ModelForm):
|
|||
|
||||
|
||||
class EditItemForm(ModelForm):
|
||||
# The picklist showing the users to which a new task can be assigned
|
||||
# must find other members of the groups the current list belongs to.
|
||||
"""The picklist showing the users to which a new task can be assigned
|
||||
must find other members of the groups the current list belongs to."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EditItemForm, self).__init__(*args, **kwargs)
|
||||
self.fields['assigned_to'].queryset = get_user_model().objects.filter(
|
||||
|
|
Loading…
Reference in a new issue