Hi,
im working on a project where in many tables data can not be deleted, but
only marked as deactivated,
Propperly handling selection of active data for normal users and all data
for admins is turning more and more tendious (in particular wrt
relationship configuration)
Im wondering if there
On Thu, Feb 27, 2014 at 8:44 AM, RonnyPfannschmidt
ronny.pfannschm...@gmail.com wrote:
Hi,
im working on a project where in many tables data can not be deleted, but
only marked as deactivated,
Propperly handling selection of active data for normal users and all data
for admins is turning
im already aware of that, but it doesnt expand to relationships and other
things
basically i need it taken into account in a lot more places
On Thursday, February 27, 2014 10:59:21 AM UTC+1, Simon King wrote:
On Thu, Feb 27, 2014 at 8:44 AM, RonnyPfannschmidt
ronny.pfa...@gmail.com
That wiki page also links to:
https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/GlobalFilter
which is intended to work with relationships as well, but it seems a
lot more complicated.
Another option might be to map to a SELECT, rather than directly to a table.
Also in the relationship docs, see relationship to non primary mapper, which
illustrates how to make ad-hoc relationships to subqueries, though typically
relationship to target where deleted=false is just a custom primary join
condition, a subquery is probably not needed here.
Sent from my
the problem is that it shouldn't just be taken into account for
relationships but all queries that operate on such a table with the flag
On Thursday, February 27, 2014 3:22:29 PM UTC+1, Michael Bayer wrote:
Also in the relationship docs, see relationship to non primary mapper,
which
I just checked out the examples for using dogpile caching mentioned here:
http://docs.sqlalchemy.org/en/rel_0_9/orm/examples.html#module-examples.dogpile_caching.
According to the example in helloworld.py if a query is cached i.e. run the
second time then the SQL is not generated.
To
Apologies if I'm missing this is the docs somewhere, but I can't figure it
out. Suppose I have a many-to-many relationship between A and B, and that
I'd like have the various B's that a particular A points to ordered by
B.ordinal (i.e. in the examples below, I'd like A.bs to be sorted to
Just noticed that I had a typo, where I wrote order_by=b.ordinal rather
than order_by=b.order. But changing it to order_by=b.order still gives:
AttributeError: 'RelationshipProperty' object has no attribute 'order'
--
You received this message because you are subscribed to the Google Groups
How do I get the objects pointed to by a many-to-many association proxy to
be sorted? In the example below, adding order_by=b.order to the backref()
produces AttributeError: 'RelationshipProperty' object has no attribute
'order', and adding order_by=b.order produces AttributeError: 'Table'
When I pass binary data to a multi-column in_ clause, I seem to be geting
inconsistent results and I need some help! I did some testing with MySQL,
Postgres, and Vertica (connecting via
https://pypi.python.org/pypi/vertica-sqlalchemy/0.1). It appears MySQL
works correctly but both Postgres
this is what the output should look like, after all the INSERT statements:
loading people
2014-02-27 18:49:25,502 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2014-02-27 18:49:25,503 INFO sqlalchemy.engine.base.Engine SELECT person.id AS
person_id, person.name AS person_name
FROM
Since this is the association object pattern, I’ll describe that first. The
pattern there is a little complicated, but if you can go with a straight
many-to-many, it is then much easier.
The relationship as specified here is from A to A_to_B. If I have an “A” row
loaded into some_a, and
On Feb 27, 2014, at 4:38 PM, Rob Crowell rob.crow...@moat.com wrote:
# in_ clause with 1 STRING, 1 BINARY
filter_cols = tuple_(HashTest.hash_val, HashTest.hash_type)
filter_vals = ((encoded_hash, 'md5'),)
q = session.query(HashTest)
q =
that patch is in for 0.8 and 0.9.
On Feb 27, 2014, at 7:29 PM, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 27, 2014, at 4:38 PM, Rob Crowell rob.crow...@moat.com wrote:
# in_ clause with 1 STRING, 1 BINARY
filter_cols = tuple_(HashTest.hash_val, HashTest.hash_type)
you have to roll it yourself. query subclass + relationship + whatever else.
On Feb 27, 2014, at 10:35 AM, RonnyPfannschmidt ronny.pfannschm...@gmail.com
wrote:
the problem is that it shouldn't just be taken into account for relationships
but all queries that operate on such a table with
or, if you totally just map that class to a SELECT statement that includes the
criterion, that will do it too. but then you’ll get a lot of SELECT subqueries
you might not want.
or, create a view using CREATE VIEW. then map to that. That is definitely the
most simple and SQL efficient way
Thank you. This was very helpful.
One non-trivial thing that stumped me for a while is that if B is derived
from a B_base using joined-table inheritance, and the order variable is in
the base table B_base, then it seems one must include B_base explicitly --
as highlighted below.
from
On Feb 27, 2014, at 9:23 PM, Seth P spadow...@gmail.com wrote:
Thank you. This was very helpful.
One non-trivial thing that stumped me for a while is that if B is derived
from a B_base using joined-table inheritance, and the order variable is in
the base table B_base, then it seems one
Good point, but unfortunately, unless I'm missing something, including only
B_base and removing B from the join doesn't seem to work when A is also
derived (using joined-table inheritance) from B_base (which is my actual
situation, despite what the nomenclature here suggest).
On Thursday,
20 matches
Mail list logo