nopaque/app/jobs/utils.py

14 lines
382 B
Python
Raw Normal View History

2023-03-14 10:13:35 +00:00
from flask import request, url_for
from app.models import Job
def job_dynamic_list_constructor():
job_id = request.view_args['job_id']
2023-03-14 10:44:15 +00:00
job = Job.query.get_or_404(job_id)
2023-03-14 10:13:35 +00:00
return [
{
'text': f'<i class="nopaque-icons left service-icons" data-service="{job.service}"></i>{job.title}',
'url': url_for('.job', job_id=job_id)
}
]