diff options
author | bnewbold <bnewbold@manus.(none)> | 2007-07-12 01:40:54 -0400 |
---|---|---|
committer | bnewbold <bnewbold@manus.(none)> | 2007-07-12 01:40:54 -0400 |
commit | 7660cb4236584e4d69b492d45133532a0a4d4791 (patch) | |
tree | 14d27eb7bf48d5917ddedf8bb998c743f5a19b55 /equations/views.py | |
parent | 39d2613b75160a47a93df560d51b30854249ce9d (diff) | |
download | equator-7660cb4236584e4d69b492d45133532a0a4d4791.tar.gz equator-7660cb4236584e4d69b492d45133532a0a4d4791.zip |
works?
Diffstat (limited to 'equations/views.py')
-rw-r--r-- | equations/views.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/equations/views.py b/equations/views.py index 8e2f6fa..9ef1081 100644 --- a/equations/views.py +++ b/equations/views.py @@ -12,19 +12,18 @@ def all_symbs(request): def equs_by_vars(request, whichvars): vars = whichvars.split(',') - if len(vars) < 1: + if len(vars) < 1 or whichvars == '': return HttpResponse('[]', mimetype="text/javascript") - #if vars[-1] == '/': - # vars = vars[:-1] + if vars[-1] == '/' or vars[-1] == '': + vars = vars[:-1] returnables = Equation.objects.filter(variables=vars[0]) if len(vars) > 1: for r in returnables: for i in vars[1:]: - if not i in r.variables: + if len(r.variables.filter(id=i)) == 0: returnables = returnables.exclude(id=r.id) if len(returnables) < 1: break data = serializers.serialize("json", returnables) return HttpResponse(data, mimetype="text/javascript") - |