Skip to content

Commit

Permalink
Merge pull request projectcaluma#191 from sliverc/docstrings
Browse files Browse the repository at this point in the history
Add help text to not self explaining fields
  • Loading branch information
czosel authored Jan 22, 2019
2 parents 465f2ef + 286f800 commit 746e60c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
6 changes: 3 additions & 3 deletions caluma/tests/snapshots/snap_test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
name: String!
description: String
meta: JSONString
addressGroups: String
addressGroups: GroupJexl
form: ID!
clientMutationId: String
}
Expand All @@ -625,7 +625,7 @@
name: String!
description: String
meta: JSONString
addressGroups: String
addressGroups: GroupJexl
clientMutationId: String
}
Expand Down Expand Up @@ -774,7 +774,7 @@
name: String!
description: String
meta: JSONString
addressGroups: String
addressGroups: GroupJexl
clientMutationId: String
}
Expand Down
33 changes: 33 additions & 0 deletions caluma/workflow/migrations/0006_auto_20190121_1440.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-21 14:40
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [("workflow", "0005_auto_20181228_1243")]

operations = [
migrations.AlterField(
model_name="task",
name="address_groups",
field=models.TextField(
blank=True,
help_text="Group jexl returning what group(s) derived work items will be addressed to.",
null=True,
),
),
migrations.AlterField(
model_name="workflow",
name="start",
field=models.ForeignKey(
help_text="Task workflow will be started with.",
on_delete=django.db.models.deletion.CASCADE,
related_name="+",
to="workflow.Task",
),
),
]
13 changes: 11 additions & 2 deletions caluma/workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class Task(SlugModel):
description = LocalizedField(blank=True, null=True, required=False)
type = models.CharField(choices=TYPE_CHOICES_TUPLE, max_length=50)
meta = JSONField(default=dict)
address_groups = models.TextField(blank=True, null=True)
address_groups = models.TextField(
blank=True,
null=True,
help_text="Group jexl returning what group(s) derived work items will be addressed to.",
)
is_archived = models.BooleanField(default=False)
form = models.ForeignKey(
"form.Form",
Expand All @@ -39,7 +43,12 @@ class Workflow(SlugModel):
meta = JSONField(default=dict)
is_published = models.BooleanField(default=False)
is_archived = models.BooleanField(default=False)
start = models.ForeignKey(Task, on_delete=models.CASCADE, related_name="+")
start = models.ForeignKey(
Task,
on_delete=models.CASCADE,
related_name="+",
help_text="First task of the workflow.",
)
form = models.ForeignKey(
"form.Form",
on_delete=models.DO_NOTHING,
Expand Down
3 changes: 3 additions & 0 deletions caluma/workflow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class GroupJexl(graphene.String):
serializer_converter.get_graphene_type_from_serializer_field.register(
serializers.FlowJexlField, lambda field: FlowJexl
)
serializer_converter.get_graphene_type_from_serializer_field.register(
serializers.GroupJexlField, lambda field: GroupJexl
)


class Task(Node, graphene.Interface):
Expand Down
6 changes: 5 additions & 1 deletion caluma/workflow/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ class Meta:


class SaveTaskSerializer(serializers.ModelSerializer):
address_groups = GroupJexlField(required=False, allow_null=True)
address_groups = GroupJexlField(
required=False,
allow_null=True,
help_text=models.Task._meta.get_field("address_groups").help_text,
)

class Meta:
model = models.Task
Expand Down

0 comments on commit 746e60c

Please sign in to comment.