I have a user model with array of ips field in my flask application. I want to use postgresql array of inet type:
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import ARRAY, INET, Integer, Unicode, Column
db = SQLAlchemy()
class User(db.Model):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
login = Column(Unicode(15))
password = Column(Unicode(34))
name = Column(Unicode(100))
permitted_ips = Column(ARRAY(INET))
But when i make query i get bad answer:
user = User.query.get(84)
print user.permitted_ips
#['{', '1', '7', '2', '.', '2', '0', '.', '2', '5', '.', '2', ',', '1', '7', '2', '.', '2', '0', '.', '2', '5', '.', '3', '}']
instead of ['172.20.25.2', '172.20.25.3']. Current version of sqlalchemy is 0.9.10. I tried the latest one but result was the same. Is it possible to fix that?