The view being shown when using Sphinx on a Django site is:
The beginning of my views.py is:
import os
from django.shortcuts import render, redirect
from django.urls import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.utils import timezone
from . forms import PlayForm, RollForm, checkBoard, BossForm
from random import randint
from . templatetags.playExtras import translateDice
from .models import Board, Winner, Boss
def getFirstFolder(req):
""" return the string between first two / - this is a hack, find out how to do it with the object """
r = req.split("'")
loc = r[1].find('/',1)
x = r[1][1:loc]
return(x)
def loadBoard(request,context,location=''):
''' Load the board from the database into context. Add a hyperlink for available squares.
:param context: context for template
:type context: dictionary
:param location: Comma seperated string of available locations or empty string so no links included.
:type location: str
:return: 'not on the board' or 'all taken' or comma seperated string of location options such as 'A0,B0'
:rtype: str
'''
req = request.__str__()