Skip to content

Commit

Permalink
[Django] Use name of variable instead of Python variable repr. (osohq…
Browse files Browse the repository at this point in the history
…#1568)

* [Django] Use name of variable instead of Python variable repr.

* Run `go mod tidy` before testing

* Drop tests for Python 3.6 on Windows

No longer supported by action actions/setup-python#355 (comment)

* Update submodules.
  • Loading branch information
samscott89 authored and bbatchelder committed May 16, 2022
1 parent c12a268 commit 4339c20
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set version env
Expand Down
1 change: 1 addition & 0 deletions docs/examples/add-to-your-application/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

test:
make -C ../../../../languages/go copy_lib
go mod tidy
go test
2 changes: 1 addition & 1 deletion docs/examples/quickstart/go
Submodule go updated from 31e678 to 2f2d68
2 changes: 1 addition & 1 deletion docs/examples/quickstart/java
Submodule java updated from 2ed954 to 20404c
2 changes: 1 addition & 1 deletion docs/examples/quickstart/nodejs
2 changes: 1 addition & 1 deletion docs/examples/quickstart/python
2 changes: 1 addition & 1 deletion docs/examples/quickstart/ruby
Submodule ruby updated from 71ab7d to a016aa
2 changes: 1 addition & 1 deletion docs/examples/quickstart/rust
Submodule rust updated from f11ac4 to 0a1e68
4 changes: 2 additions & 2 deletions docs/examples/quickstart/test_quickstarts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


quickstarts = {
go: { setup: 'go build', server: './oso-go-quickstart' },
go: { setup: 'go mod tidy && go build', server: './oso-go-quickstart' },
# TODO: add local_setup that tests against local Oso install for java
java: { setup: 'make install', server: 'make run' },
# TODO: add local_setup that tests against local Oso install for nodejs
Expand All @@ -22,7 +22,7 @@
}

if ARGV.include? "local"
quickstarts[:go][:setup] = "make -C ../../../../languages/go copy_lib && go mod edit -replace github.com/osohq/go-oso=../../../../languages/go && go build"
quickstarts[:go][:setup] = "make -C ../../../../languages/go copy_lib && go mod edit -replace github.com/osohq/go-oso=../../../../languages/go && go mod tidy && go build"
quickstarts[:python][:setup] = "pip install -e ../../../../languages/python/oso && pip install --upgrade -r requirements.txt"
quickstarts[:ruby][:setup] = "BUNDLE_GEMFILE=../Gemfile-local bundle"
quickstarts[:ruby][:server] = "BUNDLE_GEMFILE=../Gemfile-local bundle exec ruby server.rb"
Expand Down
4 changes: 3 additions & 1 deletion languages/python/django-oso/django_oso/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def get_model_by_path(

class FilterBuilder:
def __init__(self, model: Model, name="_this", parent=None):
self.name = name
self.name = (
super(Variable, name).__str__() if isinstance(name, Variable) else name
)
self.model = model
self.filter = TRUE_FILTER
# Map variables to subquery
Expand Down

0 comments on commit 4339c20

Please sign in to comment.