webbyfox
webbyfox

Reputation: 1069

how to define binary column in pas.plugin.sqlalchemy

I'm defining my custom model for pas.plugin.sqlalchemy.

Existing table of login details have binary field as password column. how should be define in model as binary. I tried to import _Binary class from SQLAlchemy after Googling but it doesn't import. Firstly I tried LargeBinary but when table been created its takes field type as Image which I dont want.

Any help would be appreciated.

Regards,

WEBBYFOX

Upvotes: 1

Views: 162

Answers (1)

Auspex
Auspex

Reputation: 2254

I'm not surprised that _Binary doesn't work - even if it did, it's generally a very bad idea to use something that's intended as a private class. But "sqlalchemy.Binary" is a perfectly acceptable type.

That said, I doubt anybody's tested pas.plugins.sqlalchemy with Binary data for the password: PAS is a way to drop-in replacements for the existing Plone system, and out-of-the-box, Plone expects passwords to be strings.

Upvotes: 2

Related Questions