<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_submission_model(uuid, read_replica=False):
 """ Helper to retrieve a given Submission object from the database. Helper is needed to centralize logic that fixes EDUCATOR-1090, because uuids are stored both with and without hyphens. """

    submission_qs = Submission.objects
    if read_replica:
        submission_qs = _use_read_replica(submission_qs)
    try:
        submission = submission_qs.get(uuid=uuid)
    except Submission.DoesNotExist:
        try:
            hyphenated_value = six.text_type(UUID(uuid))
            query = """
                SELECT
                    `submissions_submission`.`id`,
                    `submissions_submission`.`uuid`,
                    `submissions_submission`.`student_item_id`,
                    `submissions_submission`.`attempt_number`,
                    `submissions_submission`.`submitted_at`,
                    `submissions_submission`.`created_at`,
                    `submissions_submission`.`raw_answer`,
                    `submissions_submission`.`status`
                FROM
                    `submissions_submission`
                WHERE (
                    NOT (`submissions_submission`.`status` = 'D')
                    AND `submissions_submission`.`uuid` = '{}'
                )
            """
            query = query.replace("{}", hyphenated_value)

            # We can use Submission.objects instead of the SoftDeletedManager, we'll include that logic manually
            submission = Submission.objects.raw(query)[0]
        except IndexError:
            raise Submission.DoesNotExist()
        # Avoid the extra hit next time
        submission.save(update_fields=['uuid'])
    return submission