,
cascade='refresh-expire,expunge', lazy=False),
'paymenttype': relation(PaymentType,
cascade='refresh-expire,expunge', lazy=False)}
)
On Jul 29, 4:20 pm, Kent Bower k...@retailarchitects.com wrote:
No, in fact, there is no ArTranBase table
it seems like you want the polymorphic_union here, when you query ArTranBase and you want it
to eagerly load trancode and paymenttype, it would need to have a
relation() on the ArTranBase mapper so that it knows what to join.
On Jul 29, 2010, at 4:46 PM, Kent wrote:
This seems to work
I know how to get the mapper given a class or object.
How do I find the mapper or class given the table?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this
Say I track Inventory with three classes: Product, Inventory, Location
This any() expression yields the following output.
session.query(Product).filter(Product.inventory.any(Location.siteid==u'EAST')).all()
SELECT ...
FROM products
WHERE EXISTS (SELECT 1
FROM inventory, locations
WHERE
= inventory.locationid
WHERE locations.siteid = :siteid_1
Any idea what I am doing wrong?
On 6/4/2010 4:37 PM, Conor wrote:
On 06/04/2010 03:13 PM, Kent wrote:
Say I track Inventory with three classes: Product, Inventory, Location
This any() expression yields the following output.
session.query
On 5/30/2010 1:24 PM, Michael Bayer wrote:
On May 28, 2010, at 1:46 PM, Kent Bower wrote:
On 5/28/2010 10:08 AM, Michael Bayer wrote:
Is the pattern that you want to keep re-issuing a savepoint repeatedly using
the same name ? Does that have some different usage of resources versus
On 5/31/2010 9:55 AM, Michael Bayer wrote:
On May 31, 2010, at 8:24 AM, Kent Bower wrote:
Although sqla doesn't allow the user to specify the savepoint name, the same
could be accomplished given if support for the following were implemented:
Let me ask:
sp_a=begin_nested
for looking into this. Let me know if I can help further.
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr
* Is there a way besides session.commit() to free the savepoint
resource? Is there a way to provide the savepoint name, so I can use
the same name over? Lastly, if you aren't the expert, where would you
point me, zope group or TG group?
you could issue the SAVEPOINT instructions
From a quick reading of the 'transaction' package source, it looks like
you should be able to create savepoints and roll them back something
like this:
savepoint = transaction.savepoint()
try:
# ...
except:
savepoint.rollback()
raise
Thanks for the interest in helping. I
commit? I assume the answer is yes,
that is by design.
Which leads to this question: Inside a SessionExtension's
before_commit() method, how can I work out whether this is a nested
transaction vs. the root transaction?
Thanks,
Kent
--
You received this message because you are subscribed
Is the answer to second questoin session.transaction.nested?
On May 28, 1:24 pm, Kent k...@retailarchitects.com wrote:
On May 27, 6:39 pm, Michael Bayer mike...@zzzcomputing.com wrote:
commit() releases the savepoint, if thats whats going on contextually. It
doesnt actually commit
On 5/28/2010 10:08 AM, Michael Bayer wrote:
Is the pattern that you want to keep re-issuing a savepoint repeatedly
using the same name ? Does that have some different usage of resources
versus issuing/closing distinct savepoints with different names ?
As an aside, since oracle apparently has
The docs state For each begin_nested() call, a corresponding
rollback() or commit() must be issued.
In PostgreSql, according to my understanding, if there is ever a
database exception, a rollback must be issued.
This means a main reason to issue a SAVEPOINT is as a hedge against an
error.
As
201, in before_commit
assert zope_transaction.get().status == 'Committing', Transaction
must be committed using the transaction manager
AssertionError: Transaction must be committed using the transaction manager
On 5/27/2010 6:39 PM, Michael Bayer wrote:
On May 27, 2010, at 5:12 PM, Kent
When introspecting a mapper, we can figure out the class type of its
properties like this:
For ColumnProperty:
prop.columns[0].type.__class__
For RelationProperty (relationship):
prop.argument
For RelationProperty (backref):
prop.argument.class_
How do I determine the class type a
One answer is, I believe, use the name property to access the mapped
property, like this:
prop.parent.get_property(prop.name)
Is there a better way?
On May 25, 8:54 am, Kent k...@retailarchitects.com wrote:
When introspecting a mapper, we can figure out the class type of its
properties like
Ignore everything below
unicode_for_unicode = False
for Oracle lower than 9?
in previous post, I meant to delete those lines
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To
SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1 FROM DUAL
then it seems like either that fails directly, or it fails when the client
gets a hold of it. See what happens with that statement. Not sure that
Oracle 8 has NVARCHAR which might be the issue.
Please see the
*
ERROR at line 1:
ORA-00907: missing right parenthesis
=
On May 18, 12:15 pm, Kent k...@retailarchitects.com wrote:
SELECT CAST('test unicode returns' AS NVARCHAR(60)) AS anon_1 FROM DUAL
then it seems like either that fails
/2010 1:17 PM, Michael Bayer wrote:
Sorry, I meant NVARCHAR2.
SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM DUAL
works ? or no ?
On May 18, 2010, at 12:17 PM, Kent wrote:
Oops, my bad, I didn't notice you that statement changed NVARCHAR2 to
NVARCHAR:
Here
version.
It also states you can *not* store Unicode in the NCHAR datatype until
Oracle 9i.
On May 18, 1:23 pm, Kent Bower k...@retailarchitects.com wrote:
No, this is what was causing ORA-12704: character set mismatch:
SQL SELECT CAST('test unicode returns' AS NVARCHAR2(60)) AS anon_1 FROM
DUAL
VARCHAR2 for unicode data. i wasn't
aware of the N- types at that time.
also the suite of changes here is going to roll in the use_ansi flag into
the oracle 8 detection, its a bit redundant to require it manually.
On May 18, 2010, at 1:29 PM, Kent wrote:
There is a fairly short Oracle
We will definitely also need a migration tool. We've only briefly
looked into the sqlalchemy-migrate tool, but were immediately
disappointed in its apparent requirement to keep versions of the
schema.
In our book, we see the ideal tool as one that doesn't care about
versions: it just looks at the
After migrating to 0.6, we've got an apparently well running
application for postgres and Oracle 9 or above. However, as soon as
we connect to an Oracle 8 database, *everything* we attempt ends with
this: oracle error: ORA-00907: missing right parenthesis
Here is an example trying to run a
Thanks, that looks like its conceptually what we are hoping for, at least.
On 5/17/2010 3:58 PM, Tamás Bajusz wrote:
On Mon, May 17, 2010 at 9:49 PM, Kentk...@retailarchitects.com wrote:
Ideally, I agree. Practically speaking, though, we came from a
company where dozens and dozens of
this particular interaction doesn't go through regular SQLAlchemy logging.
If you really needed to see it occur you'd have to watch your oracle query
logs.
On May 17, 2010, at 3:37 PM, Kent wrote:
After migrating to 0.6, we've got an apparently well running
application for postgres
Sorry, posted too quickly, I'll get the rest of the results you asked
about...
On May 17, 4:56 pm, Kent k...@retailarchitects.com wrote:
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
Session
sqlalchemy.engine.base.Engine.0x...fb50
{}
ORA-12704: character set mismatch
(8, 1, 7, 4, 0)
On May 17, 4:58 pm, Kent k...@retailarchitects.com wrote:
Sorry, posted too quickly, I'll get the rest of the results you asked
about...
On May 17, 4:56 pm, Kent k...@retailarchitects.com wrote
:21 PM, Kent wrote:
See this script, running 0.6.0:
==
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('oracle://user:passw...@localhost:1521/xe?
use_ansi=False',echo=True)
metadata = MetaData()
Session = sessionmaker
See this script, running 0.6.0:
==
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('oracle://user:passw...@localhost:1521/xe?
use_ansi=False',echo=True)
metadata = MetaData()
Session = sessionmaker(bind=engine)
session
approach and I'll forward this idea to an author of SQLAlchemy for his
consideration.
On 5/7/2010 1:33 PM, Glyph Lefkowitz wrote:
On May 7, 2010, at 9:09 AM, Kent wrote:
Consider the case where you want your setup to install third-party
software, but you want/need to pass an argument
Mike,
Can I just take a second to thank you for your patience in running
this forum?
There are so many rude, arrogant software developers, and you seem to
not be like them at all.
Thanks.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to
The following has changed since 0.5.8 in 0.6.0. I believe this is
already known or by design from reading docs and another post but want
to point out.
If you specify a column such as this:
Column(saleprice, Numeric, nullable=False)
you get a 'numeric' type in PostgreSQL, which supports
I guess my suggestion is: since Oracle takes DECIMAL and NUMERIC to
mean NUMBER(38),
if SQLAlchemy interprets the generic types DECIMAL or Numeric with no
precision to allow for decimal or integer values, we should translate
that to 'NUMBER' for Oracle...
Thoughts?
On May 6, 12:11 pm, Kent
seems wrong.
A longer term enhancement to sqla might be to automatically expire any
relation whose join columns include a column that gets updated in a
session? Is that a manageable effort?
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
are on a legacy oracle
system or a postgres database. In some cases the 'tables' are views
that don't support RETURNING, so I'd like to turn it off for those
cases only...)
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
You think of everything? ;) Thanks
On 5/4/2010 2:41 PM, Michael Bayer wrote:
On May 4, 2010, at 2:30 PM, Kent wrote:
I understand I can disable RETURNING for an engine with
'implicit_returning=False'
Is there a way to do this for certain primary key columns only, but
not disabled engine
The following script works as expected (also in 0.5.8) with
use_ansi=True. However, with use_ansi=False, the SQL is ill-formed:
===
from sqlalchemy import *
from sqlalchemy.orm import *
engine =
. this may be a trivial issue but I cant assert that until I've had
time to study it.
On May 3, 2010, at 8:47 AM, Kent wrote:
The following script works as expected (also in 0.5.8) with
use_ansi=True. However, with use_ansi=False, the SQL is ill-formed
Thank you, sir.
On May 3, 2010, at 7:33 PM, Michael Bayer mike...@zzzcomputing.com
wrote:
OK the issue here is entirely un-subtle and its a little weird that
none of the tests we have hit upon it. this is fixed in tip.
On May 3, 2010, at 12:06 PM, Kent Bower wrote:
Note
Is it rude to ask why not disable the weakidentity map?
Under the turbogears web framework, our Sessions only exist for the
duration of the service call, and I am finding myself appending all
these objects to a no_garbage_collect list that I am keeping on the
session object anyway.
Then the
, correct?
In other words, for my understanding, or others reading the list, in a
framework where a session's life cycle only lasted as long as a web
service call, the threat of the program's memory growing unbounded is
non-existent, correct?
Kent
--
You received this message because you
May help others:
instead of col in const.columns
I needed col in list(const.columns)
to avoid: sqlalchemy.exc.ArgumentError: __contains__ requires a string
argument with the ColumnCollection object
On 4/30/2010 4:16 PM, Michael Bayer wrote:
Kent wrote:
I did read 0.6 Migration
Wait a second... ForeignKeyConstraint doesn't but PrimaryKeyConstraint
does?
(Not trying to be sassy, just wondering why I got the error in the first
place)
On 5/1/2010 2:11 PM, Michael Bayer wrote:
On May 1, 2010, at 2:04 PM, Kent Bower wrote:
May help others:
instead of col
Oh, I get it, you are saying ColumnCollection has contains_column()
method.
On 5/1/2010 4:05 PM, Kent Bower wrote:
Wait a second... ForeignKeyConstraint doesn't but
PrimaryKeyConstraint does?
(Not trying to be sassy, just wondering why I got the error in the
first place)
On 5/1/2010 2
):
=
On 5/1/2010 4:06 PM, Kent Bower wrote:
Oh, I get it, you are saying ColumnCollection has contains_column()
method.
On 5/1/2010 4:05 PM, Kent Bower wrote:
Wait a second... ForeignKeyConstraint doesn't but
PrimaryKeyConstraint does?
(Not trying to be sassy, just wondering why I got the error
it up in a separate session and then merge it into my main
session? Then, after that, merge the transient objects into my main
session? Would that get me closer? Ideally, I wouldn't want it to need
2 trips to the database.
On 4/29/2010 4:48 PM, Michael Bayer wrote:
Kent Bower wrote
I think I've got a strategy that will work and doesn't mean hacking
merge()...
Thanks for your input, if you have inspiration, I'll still gladly hear
it.
On Apr 30, 8:18 am, Kent Bower k...@retailarchitects.com wrote:
Thanks in advance for the discussion, hope I can continue without you
On 4/30/2010 11:17 AM, Michael Bayer wrote:
Kent Bower wrote:
Could I look it up in a separate session and then merge it into my main
session? Then, after that, merge the transient objects into my main
session? Would that get me closer? Ideally, I wouldn't want it to need
2 trips
I did read 0.6 Migration document.
I was using the contains_column method of ForeignKeyConstraint.
Apparently removed?
AttributeError: 'ForeignKeyConstraint' object has no attribute
'contains_column'
Easy workaround or replacement call?
--
You received this message because you are subscribed
?
In the meantime, can you recommend an approach for me? (Extend the
Session class?)
Thanks much,
Kent
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group
That sounds like it could be very useful for me, thank you for
pointing me there. That could solve one of the two issues I'm facing
that I listed... what about the other?
On Apr 29, 11:02 am, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Before saving objects to the database, we
that calculation.
Kent wrote:
That sounds like it could be very useful for me, thank you for
pointing me there. That could solve one of the two issues I'm facing
that I listed... what about the other?
On Apr 29, 11:02 am, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Before
that version of the 'orderdetails' relation)
On 4/29/2010 3:59 PM, Michael Bayer wrote:
Michael Bayer wrote:
Kent wrote:
There might be a communication problem, which an example could help
clarify.
I'm constrained by a legacy database that I have no control over
changing. When an order
/2010 3:47 PM, Michael Bayer wrote:
Kent wrote:
There might be a communication problem, which an example could help
clarify.
I'm constrained by a legacy database that I have no control over
changing. When an order is changed, I need to calculate the change in
volume (or points) so I can update
else:
# assume postgres
return func.coalesce
How would I work that out?
Thank you in advance.
On Apr 2, 4:12 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Any chance you plan to make func.now consider oracle and
use_ansi=False (and return sysdate
Thanks very much.
On 4/2/2010 5:41 PM, Michael Bayer wrote:
Kent wrote:
Along the same lines, is there something we can do about nvl()
(oracle) versus coalesce() (ansi)?
They aren't exactly the same, unfortunately (nvl takes exactly 2
arguments, no more), so maybe there is nothing
2 arguments.
In my case, I'd rather rework the nvl() function to work on other
engines besides Oracle as an alias to coalesce(), seems less ambiguous.
Thanks again.
On 4/2/2010 5:41 PM, Michael Bayer wrote:
Kent wrote:
Along the same lines, is there something we can do about nvl
ian.g.ke...@gmail.com wrote:
On Fri, Apr 2, 2010 at 3:41 PM, Michael Bayer mike...@zzzcomputing.comwrote:
Kent wrote:
Along the same lines, is there something we can do about nvl()
(oracle) versus coalesce() (ansi)?
They aren't exactly the same, unfortunately (nvl takes exactly 2
):
sql %= %s, nvl(%%s) % clauses[i]
return sql % , .join(clauses[-2:])
On 4/2/2010 7:08 PM, Ian Kelly wrote:
On Fri, Apr 2, 2010 at 3:41 PM, Michael Bayer
mike...@zzzcomputing.com mailto:mike...@zzzcomputing.com wrote:
Kent wrote:
Along the same lines, is there something we can
class inheritance so I can spot them if they
present themselves.
Any input for me or other readers at a general level?
On Apr 1, 8:26 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Apr 1, 2010, at 8:22 PM, Kent wrote:
What is the difference between:
session.query(Employee).join
Any chance you plan to make func.now consider oracle and
use_ansi=False (and return sysdate)?
On Feb 3, 4:44 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Any chance SQLAlchemy has a mechanism to switch to or fromsysdatevs.
current_datebased on the database dialect
Mike,
Suppose you have a Product object mapped to a product table. Say
there is a table for promotional_prices as well, which looks something
like this:
PRODUCTID STORE PRICE STARTDATE ENDDATE
'SKUA''WEST' 30.99 01-Aug-2009 10-Aug-2010
'SKUA''EAST'35.99 01-Aug-2009
? Is that accomplished with either the
association_proxy or column_property?
On Apr 1, 4:19 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Mike,
Suppose you have a Product object mapped to a product table. Say
there is a table for promotional_prices as well, which looks
better, can I work that out as an association property?
On Apr 1, 4:35 pm, Kent k...@retailarchitects.com wrote:
I believe (correct me if you know better) that an line subquery is
quite a bit less efficient than a join. That was my motivation for
avoiding that because there are so many rows
Thanks for the info.
Still wondering, is there a way to tell the orm (a join criterion or a
binary expression) use this function to find the param for the bind?
On Apr 1, 2010, at 6:11 PM, Michael Bayer mike...@zzzcomputing.com
wrote:
Kent wrote:
I believe (correct me if you know better
What is the difference between:
session.query(Employee).join([Engineer, Manager]).\
filter(or_(Engineer.engineer_info=='w',
Manager.manager_data=='q'))
and
session.query(Employee).with_polymorphic([Engineer, Manager]).\
filter(or_(Engineer.engineer_info=='w',
Manager.manager_data=='q'))
Any plans to support MINVALUE, MAXVALUE, CYCLE, NOCYCLE for sequences
(for both postgres and oracle)?
I've implemented a subclass of Sequence myself, but it isn't very
elegant, because I'm not familiar enough with the code to know which
methods to override for create() output.
--
You received
== 'postgres':
sql += NO CYCLE
else:
raise Exception(RSequence is only implemented
for Oracle and PostgreSQL!)
How do I get a hold of the engine from within a Sequence object?
On 3/26/2010 2:26 PM, Michael Bayer wrote:
Kent wrote
Sorry!
Nevermind, your link answers that question.
Thanks.
On Mar 26, 4:23 pm, Kent Bower k...@retailarchitects.com wrote:
Thanks for the info.
Since it is NOCYCLE in oracle and NO CYCLE in postgres, I would check
the engine.dialect.name in the compile, method correct
are they?)
On Mar 22, 2010, at 9:48 AM, Michael Bayer mike...@zzzcomputing.com
wrote:
On Mar 22, 2010, at 9:06 AM, Kent wrote:
I have a need to pass around session-dependent application data, such
as strong references to certain objects that I don't want garbage
collected so they will serve
I have a need to pass around session-dependent application data, such
as strong references to certain objects that I don't want garbage
collected so they will serve as a cache for the duration of the
session. For example, if the application performs a get() on a
SystemParameters table, I want a
With query() I can add with_lockmode('for update'). Can I do so on a
session.refresh()? What about a get()?
I see this as a useful approach to a two phase large query, where one
wants to avoid locking a large number of rows. First you would issue
a non-locking query and then, once you have a
wrote:
On Mar 19, 2010, at 12:34 PM, Kent wrote:
With query() I can add with_lockmode('for update'). Can I do so on a
session.refresh()? What about a get()?
a get() yes. a refresh() no, but that's a fine idea so I've
committed a flag for that in rab5a31b4f3bf. A substitute
obj._sa_instance_state.sort_key?? Will that always be sorted how
get() expects? Is there a more public way to get that?
On Mar 19, 1:42 pm, Kent Bower k...@retailarchitects.com wrote:
By the way, must get() always accept a primary key? For composite
keys is there a shortcut to access its
' lazy status is unaffected, even though it is in
the call to lazyload().
Is that accurate?
On Mar 17, 4:05 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Does defer only relate to ColumnProperty while lazyload relates to
RelationProperty?
Apparently I should be using
I have this schema (0.5.8):
Order.orderdetails is a collection of OrderDetail objects
(lazy=False)
OrderDetail.product is a Product object (lazy=False)
For some queries I want to defer the eager loading of
OrderDetail.product on the orderdetails collection, but would like the
Does defer only relate to ColumnProperty while lazyload relates to
RelationProperty?
Apparently I should be using lazyload() instead of defer()?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
I've got a column defined as this:
Column(cost, Numeric, nullable=False)
In Oracle, it seems I can't take advantage of the Decimal() class. I
get rounding errors as if using float instead of Decimal, see output
for Oracle vs. Postgres.
Oracle 8i (use_ansi=False):
If I use session.refresh(obj) to re-load an obj that has a one-to-many
relational property, the objects in the list are *replaced* instead of
*refreshed* if they already exist.
Suppose department has a list of employees:
suppose dept.employees = [ emp1, emp2 ]
session.refresh(dept)
the
and creates new ones. The mystery to me is what
determines when it will create new instances vs. refreshing the
existing ones?
On Mar 4, 3:24 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
If I use session.refresh(obj) to re-load an obj that has a one-to-many
relational property
in the session, not marked as dirty, and strongly
referenced on the outside. if you're using refresh you shouldn't care
about how it gets data back into the collection.
Kent wrote:
What's strange is that I can't recreate the problem on more simple
stage. Every time I refresh() on the parent
expunge them?
On Mar 4, 4:09 pm, Conor conor.edward.da...@gmail.com wrote:
Conor wrote:
Kent wrote:
I agree I shouldn't care, so maybe there is another way to attack my
problem. The reason I care is because I've extended the python object
with some auxiliary information that I need. After
Ok, I wonder the reasons, but I trust your answer completely, so I
won't disable it. Thanks for your help again.
On Mar 4, 4:26 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Kent wrote:
Thanks... that is very helpful. I could keep references to these. If
I choose the apparently lazier
I'm certain sqlalchemy's got a function call in its guts that I was
about to recreate from scratch, so I'm hoping you can spare me the
trouble.
I'm trying to construct the foreign key where clause and from clause
needed to populate a relation.
I'd explain how I got here, but might take several
Sorry, assume instead of class Order, I've got
class Product(object):
pass
On Feb 26, 1:48 pm, Kent k...@retailarchitects.com wrote:
I'm certain sqlalchemy's got a function call in its guts that I was
about to recreate from scratch, so I'm hoping you can spare me the
trouble.
I'm
Sorry, also realized the object would be *pending* instead of
transient, but it will not have a flush() ever issued due to detected
errors. I don't seem to think the fact that it is pending instead of
transient matters, but wanted to clarify.
On Feb 26, 1:51 pm, Kent k...@retailarchitects.com
mike...@zzzcomputing.com wrote:
On Feb 26, 2010, at 1:48 PM, Kent wrote:
I'm certain sqlalchemy's got a function call in its guts that I was
about to recreate from scratch, so I'm hoping you can spare me the
trouble.
I'm trying to construct the foreign key where clause and from clause
is
persistent before querying the database (doubt that's possible?)?
On Feb 26, 3:23 pm, Kent k...@retailarchitects.com wrote:
It *sounds* like exactly what I'm looking for, but when I try a simple
example, it doesn't seem to work:
ol=OrderDetail()
ol.productid = 'DININGCHAIR
= RelationProperty.argument.class_ #for backrefs, apparently
else:
cls = RelationProperty.argument
To get the order of the ident keys to pass to session.query().get():
class_mapper(cls).primary_key
Seems there might be an easier way, I'd very much like to hear it.
On Feb 26, 3:31 pm, Kent k
Bayer wrote:
On Feb 20, 2010, at 5:12 PM, Kent wrote:
If I have a persistent instance in my session and I call merge on an
object that equates to that instance, some attributes (it seems those
that aren't explicitly set on the merging instance) are expired and
get re-queried the next time
If I have a persistent instance in my session and I call merge on an
object that equates to that instance, some attributes (it seems those
that aren't explicitly set on the merging instance) are expired and
get re-queried the next time they are referenced.
We will be supporting remote databases
Suppose I have a database table, as an example, employee that has a
column dept, but the dept is not represented by any other table in
the database, it is just an attribute of employee.
I would like to be able to create a standalone relation on a class
that has no table so that I can assign lists
In case the point wasn't clear, I'd like merge() to be able to figure
out which items to add, update and, esp, delete without needing to do
that programatically myself.
On Feb 19, 7:26 am, Kent k...@retailarchitects.com wrote:
Suppose I have a database table, as an example, employee that has
, which is mapped to the
employee table):
empa = ...
empb = ...
empc = ...
department.dept = 'PAYROLL'
department.employees = [ empa, empb, empc ]
session.merge(department)
On Feb 19, 10:54 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 19, 2010, at 7:26 AM, Kent wrote:
Suppose I
, as always.
On Feb 19, 3:11 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 19, 2010, at 11:55 AM, Kent wrote:
In my example, there is only *one* table, employee. Yes, dept would
be a string column on employee.
The catch is there is *no* department table.
but what does
I'm using sqla 0.5.8 with turbogears, which uses zope (I admit
ignorance to what zope does, sorry)
When I try to turn autoflush off because I want to make numerous
changes and require queries in the meantime, the flush happens anyway
when I attempt to query.
Over-simplified example demonstrating
pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 13, 2010, at 7:05 PM, Kent wrote:
# want to do more queries and change more, so set autoflush to False
DBSession.autoflush = False
yeah sorry here, autoflush isn't propagated in 0.5.8 to the actual session
when using
If I have a one to many RelationProperty, which uses a list, how can I
check if this has been set without actually referencing it?
It seems once I reference it, it sets it to an empty list if it hasn't
been set already.
--
You received this message because you are subscribed to the Google
201 - 300 of 331 matches
Mail list logo