.
- Luke
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you
It's as simple as cls.__name__ isn't it?
Thanks again.
- Luke
PS: Some people on this list may find my (very alpha) pytest-pgtap library
helpful: https://github.com/lmergner/pytest-pgtap
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchem
s me I need to
insert the __tablename__ of
the subclass into my DDL statement. Does SqlAlchemy have a way to do this?
- Luke
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verif
quot;after_create",
cls._trigger_ddl.execute_if(dialect="postgresql"),
)
```
When __abstract__ = True the subclass is unmapped and no ddl is emitted on
create_all(). I did not expect that.
Is it possible to have the Mixin execute the event.listen or otherwise
hip as long as
all Managers are also Engineers. Is there a simpler way to accomplish this
goal or am I thinking about the problem incorrectly?
Thanks in advance,
Luke Mergner
Glendale, CA
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post e
On Monday, February 24, 2014 1:12:59 PM UTC-8, Luke wrote:
>
>
>
> On Monday, February 24, 2014 12:55:16 PM UTC-8, Michael Bayer wrote:
>>
>>
>> On Feb 24, 2014, at 2:41 PM, Luke wrote:
>>
>> Hi,
>>
>>
>>
>> class Response(Wri
On Monday, February 24, 2014 12:55:16 PM UTC-8, Michael Bayer wrote:
>
>
> On Feb 24, 2014, at 2:41 PM, Luke > wrote:
>
> Hi,
>
>
>
> class Response(Writing):
> # All responses are associated with Writing. Writing/Articles may have
> # several re
xception:
sqlalchemy.exc.AmbiguousForeignKeysError: Can't determine join between
'writing' and 'response'; tables have more than one foreign key constraint
relationship between them. Please specify the 'onclause' of this join
explicitly.
Thank you for help and
Hey Werner,
thanks for the hint.
i got the correct answer via IRC now. I'm using
http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/declarative.html#mixin-and-custom-base-classes
to achieve my goal.
Luke
--
You received this message because you are subscribed to the Google G
Hey,
how may i extend the declerative base to provide default things that are
always available to any class/table that is derived from it (like primary
keys, create timestamp columns ect) ?
i tried something like this:
import datetime
from sqlalchemy.ext.declarative import declarative_base
from
sing quote_schema=False and adding a "." to the end
of the schema value (schema="DBNAME.") but this results in
the broken SQL mentioned earlier:
SELECT [LeftTable_1].description AS [DBNAME._LeftTab_1]
Using schema="DBNAME.SCHEMANAME" didn't work either.
Please let me know ho
ch work it would be, but it _sounds_ easy. :)
Thanks.
- Luke
On Wed, Oct 14, 2009 at 3:01 PM, Luke Arno wrote:
> Thanks, Simon. Good suggestion, but these are databases and not
> schema within a database. If I use the schema="MyDatabase." (
> notice the ".") and q
y they are. :(
On Wed, Oct 14, 2009 at 11:51 AM, King Simon-NFHD78 wrote:
>
> > -Original Message-
> > From: sqlalchemy@googlegroups.com
> > [mailto:sqlalch...@googlegroups.com] On Behalf Of Luke Arno
> > Sent: 14 October 2009 16:41
> > To: sqlalchemy@googleg
e names...
BTW, sorry for not putting [sqlalchemy] in my subject line. Thanks!
- Luke
On Wed, Oct 14, 2009 at 10:01 AM, Michael Bayer wrote:
>
> Luke Arno wrote:
> > I have a MSSQL server with two logical databases. (I inherited this
> > situation,
> > of course.) The
ss Right(object): pass
mapper(Left, left_table)
mapper(Right, right_table, properties={
'lefts': relation(Left, secondary=assoc_table,
primaryjoin=right_table.c.id==assoc_table.c.right_id,
secondaryjoin=assoc_table.c.left_id==left_table
x27;notnull'] == True:
rollingfields = rollingfields + ", nullable=False"
rollingfields = rollingfields + ")"
rollingfields = rollingfields + ")"
eval(rollingfields)
meta.create_all(execengine)
-
Luke Peterso
ne 3323, in oid_column
oid = f.oid_column
AttributeError: '_TextFromClause' object has no attribute 'oid_column'
when trying to union_all the result of a (on its own, seemingly
working) generate_series select a manifestation of the bug you
mentioned or am I doing something else
On Apr 25, 8:46 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Apr 25, 2008, at 9:04 AM, Luke Iannini wrote:
>
>
>
>
>
> > Hi all,
> > Is there a way to use generate_series with SQLAlchemy?
>
> >http://www.postgresql.org/docs/8.2/interactive/func
27;t know how to translate
"s(a)/s.a" into SQLAlchemy.
As a side question, how would I add static columns to a select
statement? e.g. based on the pseudocode above:
zrows = select([generate_series.params(start=1, end=20).c.i], 0, 0,
0).label(
the
syntax, perhaps the conversion dict's values could be sql expressions,
although they'd pretty much have to be selects although context is
unclear and now inserts would be different from update/delete. For 2,
another consideration that might have kept this off the table so far
would be
s you want on your
> instances, either before flush() or within before_insert()
> operations, and SA will use those values when inserting the rows for
> the instance if they are present.
>
> On Feb 23, 2007, at 2:03 PM, Luke Stebbing wrote:
>
>
>
> > PG and Orac
This is really just a minor detail, but I noticed that Query.get(None)
will fail with an exception instead of returning None. It has the
mapper call "identity_key_from_primary_key", and that tries to do
"tuple(util.to_list(None))" -> "tuple(None)" -> TypeError.
--~--~-~--~~--
n
> practice. which databases support this feature ? i didnt think it
> was so common (though not surprised PG supports it).
>
> On Feb 22, 2007, at 1:15 PM, Luke Stebbing wrote:
>
>
>
> > Are there any plans to handle circular dependencies by using
> > deferra
Are there any plans to handle circular dependencies by using
deferrable foreign key constraints when available?
In my case, I had made the foreign key constraints deferred, but
SQLAlchemy didn't pick up on that when I reflected the database
metadata. I eliminated the circular dependency by using
quot; so that all actions performed on the parent
will propagate to the child, which will remove the need to save
children directly. See here also:
http://www.sqlalchemy.org/docs/unitofwork.myt#unitofwork_cascade
Cheers,
Luke
On Feb 11, 1:49 pm, "Nebur" <[EMAIL PROTECTED]> wrote:
&g
backref=backref("myuser",
uselist=False))
})
mapper(Userdata, t_userdata)
# create 1 instance of each object:
user1 = User()
session.save(user1)
session.flush()
user1.userdata = Userdata() ### add userdata to user, relationship
is automatically created
ses
26 matches
Mail list logo