Comments (2)
Good job! I have a small suggestion:
To keep things consistent with SQLAlchemy API, let's not create custom column types, rather let's create custom datatypes. The passlib configuration in this case can be passed directly to the underlying datatype instance:
class User(Base):
password = sa.Column(PasswordType(context={}))
I really like your latter API suggestion for this:
>>> u = User()
>>> u.password = 'b'
>>> u.password
'$5$rounds=80000$H.............'
>>> u.password == 'b'
True
We could use custom type comparator for this kind of magic.
from sqlalchemy-utils.
Agreed. 💯
from sqlalchemy-utils.
Related Issues (20)
- Event listener for aggregates can cause performance issues on import
- PhoneNumber always uses default region
- FeatReq: Add the DynamicTable class
- Unable to call refresh_materialized_view on CRDB w/SQLAlchemy 2.0 HOT 1
- Create SECURITY.md
- CompositeType support for pg8000 and psycopg3 HOT 1
- create_view not accepting `replace` argument HOT 2
- Helper functions for explicit table locks ?
- custom aggregated column does not work with nullable=False
- Database_exist not working in python 3.11 HOT 1
- Even though binary was set false, impl remain binary(16)
- generic_relationship breaks with SqlAlchemy 2.0.22 HOT 3
- [Feature] Add MySQL collation support in `create_database`
- DeprecationWarning: 'crypt' is deprecated HOT 1
- Issue with change of implementation of EncryptedType from ‘LargeBinary’ to ‘String’ HOT 1
- [Feature] Enable Cascade Behavior for generic_relationship
- [Question] how to encrypt using aws kms in sqlalchemy
- Error on model with `server_default` for `DateTime` column and `UUIDType` primary key.
- [Feature] database helpers functions don't support custom create_engine()
- New release for SQLAlchemy >= 2.0.22 HOT 19
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 sqlalchemy-utils.