Comments (2)
I have the same problem.
from django-pgcrypto-fields.
Thank you. As far as I can see my_models.filter(pgp_pub_field='h')
will not work as you have to explicitly use the decrypted
lookup to query the decrypted value of the field.
>>> my_models.filter(pgp_pub_field__decrypted='h')
>>> my_models.filter(pgp_pub_field__decrypted='haa')
>>> my_models.filter(pgp_pub_field__decrypted='1111')
The 3 querysets above can work if any of your two instances <QuerySet [<MyModel: #1>, <MyModel: #2>]>
have either h
, haa
or 1111
as values.
I can see that your first object has 'hello, world!\r\n안녕하세요.'
as value for pgp_pub_field
. You can then filter with the following and you should have an object back:
>>> my_models.filter(pgp_pub_field__decrypted='hello, world!\r\n안녕하세요.')
from django-pgcrypto-fields.
Related Issues (20)
- Unique constraints HOT 3
- Single quote in PGCRYPTO_KEY string causes syntax error HOT 2
- Support of type BOOLEAN field HOT 2
- TypeError: %i format: a number is required, not str HOT 3
- DateTimePGPSymmetricKeyField does not save with timezone info, is this a defect? HOT 1
- How to retrieve raw encrypted value? HOT 2
- ExternalRoutineInvocationException: Need password for secret key HOT 2
- Want to know Encryption type AES128 or AES256 is used? HOT 1
- `__in` type queries do not work with encrypted fields? HOT 1
- problem with Decimal fields HOT 5
- TextHmacField doesnt encrypt with correct password PGCRYPTO_KEY HOT 1
- Sharing encrypted DB in multiple Django projects HOT 1
- Performance HOT 1
- Release master to PyPI HOT 4
- Length of character varying columns in database is insufficient HOT 1
- function pgp_pub_decrypt(character varying, bytea) does not exist
- Indexing alternatives on these fields
- missing BooleanPGPSymmetricKeyField HOT 1
- Django 5.0 and Python 3.11 support
- How are searches, filters and gets handled?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-pgcrypto-fields.