SQLAlchemy release 1.0.1 is now available.
This is a quick bug-fix release that repairs several new regressions
identified in the 1.0.0 release, not found during the beta period. All
users of 1.0.0 are encouraged to upgrade to 1.0.1.
Key elements of this release include fixes regarding the
Would it somehow be possible to access the __tablename__ in server_default?
What I'm looking for is something like this:
class PositionMixin(object):
@declared_attrdef position(cls):
return Column(Integer,
server_default=text(nextval('%(__tablename__)s_id_seq')))
--
You
if you are using __tablename__ what happens if you just refer to
cls.__tablename__ in that method ?
On 4/23/15 3:46 PM, Jacob Magnusson wrote:
Would it somehow be possible to access the __tablename__ in
server_default? What I'm looking for is something like this:
|class
I have a couple of tables that I want to reflect. The first is a data table
where one of the columns is a foreign key to the second table.
If I used SQLAlchemy declarative_base, a query might look something like
this:
session.query(Client.name, Suburb.label).join(Suburb) # In the Client class
On 4/23/15 5:15 PM, Jeffrey Yan wrote:
I have a couple of tables that I want to reflect. The first is a data
table where one of the columns is a foreign key to the second table.
If I used SQLAlchemy declarative_base, a query might look something
like this:
|
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',
On Sunday, April 19, 2015 at 7:08:41 PM UTC-4, Michael Bayer wrote:
If I want *all* of the Thing object, I change it to this:
q = s.query(Thing, func.count(Comment.type)).\
filter(Thing.creation = datetime.date(2015, 4, 19)).\
filter(Thing.creation datetime.date(2015, 4, 26)).\
SQLAlchemy release 1.0.1 is now available.
This is a quick bug-fix release that repairs several new regressions
identified in the 1.0.0 release, not found during the beta period. All
users of 1.0.0 are encouraged to upgrade to 1.0.1.
Key elements of this release include fixes regarding the