Thanks for the ideas. I thought of all of the above. The one I've
been using is the accessor which unions together the necessary
things. My question came up when I wondered if there was some even
more fundamental way to handle these forwards-backwards cases. I'm
glad to know I'm already doing
there is... u do not want to know if A points B or B points A, u want
to know if A and B are related in whatever aspect. That is, A and B
are members of some set X denoting that aspect. i.e. moving the
belonginess out of A and B alltogether.
but this isn't going to make your DB simpler...
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Faheem Mitha
Sent: 04 December 2008 20:43
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] returning primary key of object without
know what it is called.
Hi,
I'm trying to
Hi,
There are some sphinx system messages on:
http://www.sqlalchemy.org/docs/sphinxtest/intro.html
Reference Documentation¶
*
System Message: WARNING/2
(/home/classic/dev/sphinx/doc/build/intro.rst)
undefined label: datamapping – if you don't give a link
caption
i'm asking about SA-related stuff, i know how to handle the python
side. how to lock relations, collections etc - how to make an
instance readonly?
and eventualy if it is poosible after that to unlock that instance at
some point - so lock all the user-visible stuff but leave some
flag
On Fri, 5 Dec 2008, King Simon-NFHD78 wrote:
You can get the mapper for a given instance using the
sqlalchemy.orm.object_mapper function, and that mapper has a
'primary_key_from_instance' method. A generic primary_key function might
look like this (untested):
import sqlalchemy.orm as orm
Hi all,I'm trying to get deletes and updates cascaded down from a parent
object to the child objects (connected by ForeignKey).
It all seems pretty simple in the docs, but I can't get it to work! I'm
using MySQL with the InnoDB engine, and have played with all the variation
of the onupdate,
The searching is a bit weird.
If I search for Adjacency I get no results. If I search for adjacency
(all lower case) I get results, the first of which has an upper-cased
Adjacency.
Otherwise they look nice and I'm sure will look nicer-yet as time goes on!
--
Jon
On Dec 5, 2008, at 11:10 AM, [EMAIL PROTECTED] wrote:
i'm asking about SA-related stuff, i know how to handle the python
side. how to lock relations, collections etc - how to make an
instance readonly?
and eventualy if it is poosible after that to unlock that instance at
some point - so
well we have no control over any of thatI don't know that Sphinx
search uses case insensitivity for full text searches.
On Dec 5, 2008, at 11:53 AM, Jon Nelson wrote:
The searching is a bit weird.
If I search for Adjacency I get no results. If I search for adjacency
(all lower case)
use the passive_updates=True, passive_deletes='all' flags. These
are described at
http://www.sqlalchemy.org/docs/05/sqlalchemy_orm.html#docstrings_sqlalchemy.orm_modfunc_relation
.
On Dec 5, 2008, at 11:42 AM, James Brady wrote:
Hi all,
I'm trying to get deletes and updates cascaded
actually, use passive_deletes=True, not 'all'. It will issue DELETEs
only for collections that are already loaded, this doesn't break
anything and prevents unnecessary SELECTs of unloaded collections.
The True setting is needed so that the session can update the state of
those
On 05.12.2008 17:10 Uhr, [EMAIL PROTECTED] wrote:
i'm asking about SA-related stuff, i know how to handle the python
side. how to lock relations, collections etc - how to make an
instance readonly?
and eventualy if it is poosible after that to unlock that instance at
some point - so lock all
On Friday 05 December 2008 19:22, Michael Bayer wrote:
On Dec 5, 2008, at 11:10 AM, [EMAIL PROTECTED] wrote:
i'm asking about SA-related stuff, i know how to handle the python
side. how to lock relations, collections etc - how to make an
instance readonly?
and eventualy if it is
ah yes, i forgot that already have that in dbcook!
but i dont think it will avoid adding things to collections.
okay thanks i'll dig further.
On Friday 05 December 2008 19:39, Andreas Jung wrote:
On 05.12.2008 17:10 Uhr, [EMAIL PROTECTED] wrote:
i'm asking about SA-related stuff, i know
Ah, I should say I'm using SA 0.4.3 - I going to try the same test on
0.5
On Dec 5, 11:36 am, Michael Bayer [EMAIL PROTECTED] wrote:
actually, use passive_deletes=True, not 'all'. It will issue DELETEs
only for collections that are already loaded, this doesn't break
anything and
Assuming user_id is a surrogate primary key, I dont see any need for
onupdate=CASCADE to be used here. Additionally, ondelete=CASCADE
on your hat.user_id column implies that hat will be deleted when a
user entry is deleted - however your relation has this set up on the
many-to-one side
Yep, the same behaviour in 0.5rc4
On Dec 5, 12:44 pm, James [EMAIL PROTECTED] wrote:
Ah, I should say I'm using SA 0.4.3 - I going to try the same test on
0.5
On Dec 5, 11:36 am, Michael Bayer [EMAIL PROTECTED] wrote:
actually, use passive_deletes=True, not 'all'. It will issue DELETEs
Ah! I see - I had the cascade and passive_delete arguments in the
wrong place.
This works as expected in 0.4.3 and 0.5 now.
Thanks for the help
James
On Dec 5, 12:47 pm, Michael Bayer [EMAIL PROTECTED] wrote:
Assuming user_id is a surrogate primary key, I dont see any need for
Hi,
I'm using sqla with the following schema (see below). I'm creating a cell
object implicitly, using the function make_cell and the association proxy
pattern.
def make_cell(patient_obj, snp_obj, snpval):
patient_obj.snps[snp_obj] = snpval
return patient_obj
My question is, is
On Dec 5, 2008, at 3:01 PM, Faheem Mitha wrote:
Hi,
I'm using sqla with the following schema (see below). I'm creating a
cell
object implicitly, using the function make_cell and the association
proxy
pattern.
def make_cell(patient_obj, snp_obj, snpval):
Hi all,
There appear to be some nuances to using order by statements with set
operations like unions in MySQL but the following is allowed*:
(SELECT a,b from DBA.tbl ORDER BY b LIMIT 5)
UNION ALL
(SELECT a,b from DBB.tbl ORDER BY b LIMIT 5)
ORDER BY b
When I attempt to generate such a
try calling self_group() on each select object.
On Dec 5, 2008, at 3:55 PM, Bo Shi wrote:
Hi all,
There appear to be some nuances to using order by statements with set
operations like unions in MySQL but the following is allowed*:
(SELECT a,b from DBA.tbl ORDER BY b LIMIT 5)
UNION ALL
Thanks for the quick response!
The following does *not* work. Am I making the call incorrectly?
sel = union_all(*[q.self_group() for q in querylist])
On Fri, Dec 5, 2008 at 4:08 PM, Michael Bayer [EMAIL PROTECTED] wrote:
try calling self_group() on each select object.
On Dec 5, 2008,
that's correct. what does it render ?
On Dec 5, 2008, at 4:17 PM, Bo Shi wrote:
Thanks for the quick response!
The following does *not* work. Am I making the call incorrectly?
sel = union_all(*[q.self_group() for q in querylist])
On Fri, Dec 5, 2008 at 4:08 PM, Michael Bayer [EMAIL
greetings,
SA (0.5.0rc1) keeps returning utf hex in stead of utf-8 and in the
process driving me batty. all the mysql setup is fine, the chars look
good and are umlauting to goethe's delight. moreover, insert and
select are working perfectly with the MySQLdb api on three different
*nix systems,
from sqlalchemy import *
s = select([x, y]).select_from(table)
print union_all(s.self_group(), s.self_group()).order_by(foo)
(SELECT x, y
FROM table) UNION ALL (SELECT x, y
FROM table) ORDER BY foo
On Dec 5, 2008, at 4:17 PM, Bo Shi wrote:
Thanks for the quick response!
The
I'm not sure of the mechanics of what you're experiencing, but make
sure you use charset=utf8use_unicode=0 with MySQL.
On Dec 5, 2008, at 4:17 PM, n00b wrote:
greetings,
SA (0.5.0rc1) keeps returning utf hex in stead of utf-8 and in the
process driving me batty. all the mysql setup is
I had to upgrade to 0.4.7 from 0.4.2, but your sample query works,
however, my application of it does not.
Sorry I'm being so light on details, I'll try to reproduce with a
complete sample versus using snippets of production code.
Each select statement is generated like so:
sel =
there's logic which is removing the order_by's from the selects, and
in that case this is what's blowing away the parenthesis as well.
Some databases don't even allow ORDER BY inside of the queries used in
a UNION since in the absense of LIMIT/OFFSET, which also is not
standard SQL,
Oh, right. I don't know what type of brain fog obscured that basic
relational fact, except that I may have been burning my synapses a bit
too hot lately resulting in a deplorable deficit of
neurotransmitters. Thank you for helping me regain the sight of the
obvious.
On Dec 5, 1:16 am, [EMAIL
Thanks; the monkeypatch approach works nicely. Using the alias()
method will raise
AttributeError: 'Alias' object has no attribute '_order_by_clause'
On Fri, Dec 5, 2008 at 7:25 PM, Michael Bayer [EMAIL PROTECTED] wrote:
there's logic which is removing the order_by's from the selects,
Mike,
Gaetan's right -- I just viewed the site a day after you (Mike) said
that the li issue had been fixed, but they're still too widely
spaced for sure. There are several conflicting (well ok, inheriting/
overriding) settings of line-height across the various css files, and
it does not appear
Forgot to add that I can't see much reason for links to be given a
line-height that would be any different from the text that surrounds
them -- at least not on the TOC page. That's why I felt free to scrap
the 'a' rule and put the 'li li' in the same spot. If the 'a' rule is
necessary for other
Oh yeah, and in Main Documentation (at least) you have some ul
class=simple lists nested inside of blockquote elements, which is
resulting in some of your lists being much farther indented than
others, without a good visual reason why. Seems like the difference
could be eliminated.
I sent new
35 matches
Mail list logo