Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete from admin - You cannot .filter() on a DjangoCassandraQuerySet which has been ordered using python #133

Open
brylor opened this issue Jun 6, 2019 · 1 comment

Comments

@brylor
Copy link

brylor commented Jun 6, 2019

If I try to delete from the admin:

settings.py has CASSANDRA_FALLBACK_ORDER_BY_PYTHON = True

I get:

`

Request Method: POST
http://192.168.0.1:8080/admin/accounts/accountmodel/
1.11.21
NotImplementedError
You cannot .filter() on a DjangoCassandraQuerySet which has been ordered using python
/usr/lib/python2.7/site-packages/django_cassandra_engine/models/init.py in _raise_not_implemented, line 597
/bin/python
2.7.14
['/root/whitelist', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages']
Thu, 6 Jun 2019 19:39:43 +0000
`

If I set it to CASSANDRA_FALLBACK_ORDER_BY_PYTHON = False I get:

`

Request Method: GET
http://192.168.0.1:8080/admin/accounts/accountmodel/
1.11.21
QueryException
Can't order by the first primary key (partition key), clustering (secondary) keys only To enable fallback order_by() python implementation, set "CASSANDRA_FALLBACK_ORDER_BY_PYTHON = True" in Django Settings.
/usr/lib/python2.7/site-packages/django_cassandra_engine/models/init.py in order_by, line 762
/bin/python
2.7.14
['/root/whitelist', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages']
Thu, 6 Jun 2019 19:43:15 +0000
`

my model is:

class AccountModel(DjangoCassandraModel):
pk = columns.UUID(primary_key=True, default=uuid.uuid4)
account_id = columns.Text()
divison_id = columns.Text()

@alexander-jacob
Copy link

Same problem here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants