Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image to step #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django_workflow_system/admin/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SteptextInline(admin.TabularInline):
class StepUserInputForm(forms.ModelForm):
class Meta:
model = WorkflowStepUserInput
fields = ["ui_identifier", "required", "type", "specification"]
fields = ["ui_identifier", "required", "type", "specification", "url"]

class Media:
js = ("admin/js/jquery.init.js",)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.1.13 on 2022-04-20 13:52

from django.db import migrations, models
import django_workflow_system.utils.media_files


class Migration(migrations.Migration):

dependencies = [
('django_workflow_system', '0010_auto_20211105_0940'),
]

operations = [
migrations.AddField(
model_name='workflowstepuserinput',
name='url',
field=models.ImageField(max_length=200, null=True, upload_to=django_workflow_system.utils.media_files.workflow_step_media_location),
),
]
5 changes: 5 additions & 0 deletions django_workflow_system/models/step_user_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
single_choice_question_schema,
true_false_question_schema,
)
from django_workflow_system.utils import workflow_step_media_location


class WorkflowStepUserInput(CreatedModifiedAbstractModel):
Expand Down Expand Up @@ -53,6 +54,10 @@ class WorkflowStepUserInput(CreatedModifiedAbstractModel):
)
type = models.ForeignKey(WorkflowStepUserInputType, on_delete=models.PROTECT)

url = models.ImageField(
upload_to=workflow_step_media_location, max_length=200, null=True
)

class Meta:
db_table = "workflow_system_step_user_input"
unique_together = ["workflow_step", "ui_identifier"]
Expand Down