def process_bind_param(self, value, dialect):
if value is not None:
- assert len(value), "Does not support empty lists"
- value = '/'.join(value)
+ if len(value) == 0:
+ value = None
+ else:
+ value = '/'.join(value)
return value
def process_result_value(self, value, dialect):
email = Column(Unicode, nullable=False)
created = Column(DateTime, nullable=False, default=datetime.datetime.now)
pw_hash = Column(Unicode, nullable=False)
- email_verified = Column(Boolean)
+ email_verified = Column(Boolean, default=False)
status = Column(Unicode, default=u"needs_email_verification", nullable=False)
verification_key = Column(Unicode)
is_admin = Column(Boolean, default=False, nullable=False)
description = Column(UnicodeText) # ??
description_html = Column(UnicodeText) # ??
media_type = Column(Unicode, nullable=False)
- state = Column(Unicode, nullable=False) # or use sqlalchemy.types.Enum?
+ state = Column(Unicode, default=u'unprocessed', nullable=False)
+ # or use sqlalchemy.types.Enum?
license = Column(Unicode)
fail_error = Column(Unicode)
# attachment_files
# fail_error
+ _id = SimpleFieldAlias("id")
+
def get_comments(self, ascending=False):
order_col = MediaComment.created
if not ascending:
get_author = relationship(User)
+ _id = SimpleFieldAlias("id")
+
def show_table_init():
from sqlalchemy import create_engine