http://docs.peewee-orm.com/en/latest/peewee/changes.html#fields
What are the alternatives for PasswordField and PickledField on 3.x ?.
What are you using if you need PasswordField and PickledField on 3.x ?.
The Documentation dont mention alternatives.
:thinking:
Hey, those are no longer supported. PasswordField had some legitimate security concerns raised about it, and I don't want to give the false sense of security as to what it claims to do. PickleField is quite easy to implement in your own code or in a library.
import sqlite
import pickle
class PickledField(BlobField):
def python_value(self, value):
if isinstance(value, (bytearray, sqlite3.Binary)):
value = bytes(value)
return pickle.loads(value)
def db_value(self, value):
return sqlite3.Binary(pickle.dumps(value, 2))
Thank you very much!.
Field now lives here, in case someone still need it, or to ease migration to 3.x:
https://github.com/juancarlospaco/peewee-extra-fields#pickledfield
:smiley:
Good stuff brotha, thanks
So should we use https://github.com/juancarlospaco/peewee-extra-fields#simplepasswordfield instead?
Just in case anyone was troubleshooting PickleField
http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#PickleField
from playhouse.fields import PickleField
Most helpful comment
Thank you very much!.
Field now lives here, in case someone still need it, or to ease migration to 3.x:
https://github.com/juancarlospaco/peewee-extra-fields#pickledfield
:smiley: