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

Passing func type argument to Model.create does not work as expect #736

Open
roycefanproxy opened this issue Oct 29, 2020 · 1 comment
Open

Comments

@roycefanproxy
Copy link

  • GINO version: 1.0.1
  • Python version: 3.8
  • asyncpg version: 0.21
  • PostgreSQL version: 12.4

Description

Model.create() does not seem to work with sqlalchemy.func object.

What I Did

Currently I make use of crypt() and gen_salt() from pgcrypto extension to generate password hash.
What I want to do is to create a user record as follow:

new_user = await User.create(email="[email protected]", password=func.crypt(pass_val, func.gen_salt('bf', 7)), **data)

Is my understanding of Model.create usage wrong or it's a bug, or a feature doesn't support yet?

@fantix
Copy link
Member

fantix commented Dec 7, 2020

Right, this was not considered yet - I made it partially work a few days ago, but I'll need a few more weekends to make it hit production.

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

No branches or pull requests

2 participants