emmett-framework / emmett

The web framework for inventors
Other
1.03k stars 70 forks source link

About Fixed pbkdf2 library values representation #360

Closed josejachuf closed 3 years ago

josejachuf commented 3 years ago

Hi @gi0baro

From [1], when I try this I get an error

User.where(lambda u: u.password.contains("b'")).select()

raise SyntaxError("contains used with incompatible field type") File "\<string>", line None SyntaxError: contains used with incompatible field type

Jose

[1] https://emmett.sh/docs/2.2.x/upgrading#version-22

gi0baro commented 3 years ago

@josejachuf seems you spotted a bug in pyDAL regarding password fields. My bad I didn't checked carefully the execution.

You can use like and change your query to:

User.where(lambda u: u.password.like("%b'%"))

I gonna update the documentation accordingly. Regarding the contains method with password fields, let's see if I can override the behaviour in next release.