Open pbysh opened 5 years ago
linebreaks
is added to job.exc_info
because exc_info
is a string. I'm not sure how linebreaks
behave if you feed it data type that's not string (for example if the job is not finished, it returns None
).
Depending on the function being executed, the return types could also be other Python data structures.
linebreaks
casts whatever is passed to it to a string, which is what is happening anyways because it's being printed, so I don't see how it would hurt?
You're right. Please open a PR for this :)
Ditto @selwin
Ming opening a PR for this?
Just got done setting everything up with django-rq and I have to say I am a huge fan of the project so far. My favorite thing, by far, is the integration with the Django admin panel that gives me a very nice interface to be able to look through my queues, jobs, and results.
I don't know if this is a misuse of the "result" of a Job, but I am using it to give me a relatively brief "log" of the events that transpired within the job. I know there are some services for this sort of thingbut I don't need anything too involved. Ultimately I end up returning a string of events separated by newlines. Unfortunately while the stacktrace of exceptions has the
linebreaks
template tag applied to it, the results do not:So, all that is to say, I think it would be pretty harmless to add
|linebreaks
to{{ job.result }}
if at all possible. I have already done this but have had to copy job_result.html which is not ideal.Thanks.