On Nov 9, 2011, at 3:37 AM, sector119 wrote:
>
> ### TEST 2
> # HERE I GOT ERROR if I uncomment "user = ..." line
>
> session = Session()
>
> report = session.query(Report).get(1)
> #user = session.query(User).filter_by(username='sector119').one()
> comment = Comment(content=u'test comment', u
id never heard of a functional unique constraint but there you go, here's a
stack overflow answer for this one:
http://stackoverflow.com/questions/1510018/compound-uniqueconstraint-with-a-function
On Nov 10, 2011, at 1:15 AM, lestat wrote:
> Can I add UniqueConstraint like this?
>
>
> from
On Nov 9, 2011, at 5:27 PM, Ryan wrote:
> I have a MySQL VARCHAR column, but I'd like to get ENUM-like behavior at the
> ORM level. I'm using the declarative style. Here's what I've got so far:
>
> language = Column(Enum('en', 'fr', native_enum=False), CheckConstraint(),
> default='en')
>
> D
On Nov 10, 2011, at 11:59 AM, Ian Wilson wrote:
> I'm not sure if this is a case of user error or what but I'm trying to
> use a double sub-query load. The odds are probably pretty good that
> I'm doing something wrong. I just finally got around to trying
> subqueryload and I think it is what I
On Nov 10, 2011, at 2:09 AM, lestat wrote:
> How I can add default NULL for column?
>
> class UserIp(db.Model, UnicodeMixin):
>__tablename__ = 'user_ip'
>
>user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
> primary_key=True, nullable=True, server_default=None)
>ip = db.Colu
I'm not sure if this is a case of user error or what but I'm trying to
use a double sub-query load. The odds are probably pretty good that
I'm doing something wrong. I just finally got around to trying
subqueryload and I think it is what I've been looking for my entire
life. Although the SQL bei
On Nov 10, 2011, at 12:57 PM, Michael Bayer wrote:
>
> On Nov 10, 2011, at 9:34 AM, Mark Erbaugh wrote:
>
>> I'm trying to use data from a sequence to add columns to a SQLAlchemy table
>> created declaratively. Here's what I'm doing:
>>
>> class Sizing(Base):
>> __tablename__ = 'sizing'
>>
On Nov 10, 2011, at 9:34 AM, Mark Erbaugh wrote:
> I'm trying to use data from a sequence to add columns to a SQLAlchemy table
> created declaratively. Here's what I'm doing:
>
> class Sizing(Base):
>__tablename__ = 'sizing'
>id = Column(Integer, primary_key=True)
>
>[...]
>
>
>
I'm trying to use data from a sequence to add columns to a SQLAlchemy table
created declaratively. Here's what I'm doing:
class Sizing(Base):
__tablename__ = 'sizing'
id = Column(Integer, primary_key=True)
[...]
for name in ('column1', 'column2', 'column3', ...):
x = Column(typ
Hello,
I'm not an artist but I just tried to make a logo artwork for
SqlAlchemy-Migrate.
http://dev.elveos.org/sqlalchemy-migrate-logo/sql_alchemy_migrate.html
The logo is a reference to the swallow problem in "Monty Python and
the Holy Grail".
Fred
Elveos Developer
https://elveos.org
On 2 n
Michael,
Thanks! Using create_engine(..., poolclass=SingletonThreadPool) works
perfectly, though create_engine(..., pool_threadlocal=True) still showed
similar database is locked on 'session commit'
FWIW, I do have a single engine, connection, and session in the
application, as with (now):
How I can add default NULL for column?
class UserIp(db.Model, UnicodeMixin):
__tablename__ = 'user_ip'
user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
primary_key=True, nullable=True, server_default=None)
ip = db.Column(postgres.CIDR, nullable=False,
server_default='127.0.0.
Can I add UniqueConstraint like this?
from sqlalchemy import func
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.dialects import postgres
class UserIp(db.Model):
__tablename__ = 'user_ip'
__table_args__ = (
UniqueConstraint('user_id', func.md5('ip')),
)
13 matches
Mail list logo