create table posts (
id serial primary key,
view_count integer default 0 not null,
vote_count integer default 0 not null
);
create index on posts((case view_count when 0 then 0 else vote_count::float /
view_count end));
class Post(SQL_DB.meta):
__table__ = sa.Table('posts',
I've found that sometimes sqlalchemy inserts objects during
session.commit() not in the order they have been added using session.add()
I've put my code example and the output to the github gist.
https://gist.github.com/vpol/8da4a512308ae351eaf6
My question is similar to this one:
I have two classes
table_external_numbers = sa.Table('external_numbers', meta.metadata,
sa.Column('en_id', sa.types.Integer, primary_key = True),
sa.Column('en_prefix', sa.types.Integer, nullable = False),
sa.Column('en_use_called', sa.types.Boolean, nullable = False),
)
class