Stefano Bartaletti wrote:
I need to gather IDs in after_commit because theID is a serial Postgres value
that is available only after flush()
Not really... in postgres, you can ask to consume the next sequence
value with SELECT NEXTVAL('sequence_name') and explicitly set that as
primary
Vladimir Iliev wrote:
hi, is it possible to add a non-caching column_property() to my mapping?
You can use expire() on a single column, so you could proxy that column
with a @property that also expires it.
--
This e-mail (and any attachment(s)) is strictly confidential and for use only
Rick Morrison wrote:
Hi Marco,
[...]
Thank you. Very helpful.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe
I need to evaluate a third-party application, that will be integrated
with others by one of my programs.
My integration app runs on linux with SA 0.4, and I will strive to use
the latest stable release.
I need to write a couple of requirements to choose the third-party
application.
Will I
lur ibargutxi wrote:
'idindicatorgroupcontainer' : relation(IndicatorGroups,
primaryjoin=sql.and_(IndicatorGroups.idindicatorgroup==GroupGroups.idindicatorgroupcontainer)),'idindicatorgroupcontained'
: relation(IndicatorGroups,
lur ibargutxi wrote:
I forgot. Try using tables instead of classes that are not mapped yet..
mappers['groupgroups'] = mapper(GroupGroups, tables['groupgroups'],
properties = {
'idindicatorgroupcontainer' : relation(IndicatorGroups,
Lukasz Szybalski wrote:
dev.cfg has
sqlalchemy.dburi=mysql://user:[EMAIL PROTECTED]:3306/dbname
sqlalchemy.convert_unicode = True
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
James Brady ha scritto:
Hi Marco, assign_mapper did help - the relations are now accessible
through my models, and the query syntax is nicer than pure SA as well
in my opinion.
However, I'm using the identity framework (part of TurboGears)
Me too.
which unfortunately doesn't play nicely
James Brady ha scritto:
The problem I'm hitting at the moment is how to properly select simple
objects... There seems to be two main approaches, for example:
session.query(Ownership).select() or
ownership_table.select().execute()
With the first approach, I get
InvalidRequestError: Parent
Lukasz Szybalski ha scritto:
I am trying to insert a record with a compound primary key that consists of
Team_Sid, User_Sid
I can either do
i = users_table.insert()
i.execute(TEAM_SID=343, USER_SID=1,TEAM_NAME='the team')
i.execute(TEAM_SID=343, USER_SID=2,TEAM_NAME='the team')
Travis Kriplean ha scritto:
However, this seems a bit ugly. Is there a way to obtain a non-
transactional connection from an engine in 0.3.10? If not, is it
possible in 0.4?
I use this with SA 0.3.10 and Postgres:
Lukasz Szybalski ha scritto:
Got another error here. but I guess its fixed in a newer version of
sqlalchemy via ticket 482
Yes. I wasn't aware of 482 because I usually try to avoid table names
that _must_ be escaped (mixed caps, reserved words, etc).
put assign_mapper() in place of
Glauco ha scritto:
Thank you kevin , i've worked a lot over PG and this tecnique is
consolidated in our model.. but here the problem is that the column
is a simplycolumn_name INTEGER NOT NULL references
other_table(id) and i cannot understand why sqlalchemy whant to use it
as a
Lukasz Szybalski ha scritto:
bind_meta_data()
users_table = Table('users', metadata, autoload=True)
class Users(object):
pass
usersmapper=mapper(Users,users_table)
assign_mapper() in place of mapper()
mysession=session.query(Users)
1. What would be the code from now on to
Alexandre CONRAD ha scritto:
Maybe this should need some attention to implement in SA some API to
handle nodes (insert, move, remove) of herachical trees in SA the
Nested Set way.
There are several ways to implement schema and rules (and therefore
APIs) just by looking at Celko's
Michael Bayer ha scritto:
can i have an example
http://trac.turbogears.org/browser/branches/1.0/turbogears/database.py?rev=2320
281 [run_with_transaction.when(_use_sa())]
282 def sa_rwt(func, *args, **kw):
283 log.debug(New SA transaction)
284 transaction =
svilen ha scritto:
Anyway it may depend which audience are u targeting with these names -
those who never seen an API or those for which names are important
only to associate them with a library/version/use-case... both
extremes are equaly uninteresting imo.
I think targeting those
[EMAIL PROTECTED] ha scritto:
here some theory on comparing data trees, in order to produce the
changeset edit scripts.
http://www.pri.univie.ac.at/Publications/2005/Eder_DAWAK2005_A_Tree_Comparison_Approach_to_Detect.pdf
The complete title of the paper is A Tree Comparison Approach To
Anton V. Belyaev ha scritto:
again, im not opposed to this feature and ill patch in an adequate
(and fully unit-tested) implementation. but have you actually ever
*had* this problem? or is it just hypothetical ?
For example, a developer modifies the metadata and checks in. Another
Roger Demetrescu ha scritto:
query.get(dict(columnB='foo', columnA='bar')
Lazy programmers are the best ones... :)
That's the reason lazy programmers share a superclass for all their
domain objects... hint, hint :-)
--~--~-~--~~~---~--~~
You received
svilen ha scritto:
on a side note, here or for the query(), once i add .order_by() and
similar, will be a possibility to remove/cancel them?
e.g. .order_by(None) - similar to .join(None)?
or should i keep a copy at the point before adding .order_by()?
e.g.
i want:
q1 = query.filter(
svilen ha scritto:
because q1 with the order is _the_ query, made at point A somewhen,
and stored there as a construct; much later at some point B i need to
use that query but without the ordering - now i have to keep 2 copies
of the query, w/ and w/out order. And this strip-the-ordering
Sanjay ha scritto:
BTW, the session transaction is stored in
cherrypy.request.sa_transaction.
Yes, but it's been added recently.
Does this help simplify the statements?
Transaction instances have a connection() property.
So, cherrypy.request.sa_transaction.connection should work.
Sanjay ha scritto:
Need help on how to do it. Being a turbogears application where db
entities like metadata and session are imported rather than created by
me, I am confused and could not successfully implement the pattern
provided in the docs.
I'm sure there are cleaner ways, but this
Edin Salkovic ha scritto:
Currently, SQLAlchemy's setup(...) hasn't set this arg, meaning that
setuptools uses its own algorithm to determine if SQLAlchemy can be
installed as a zipped egg.
You can switch off zip for all newly installed eggs, in ~/.pydistutils.cfg
[easy_install]
zip_ok
Michael Bayer wrote:
please file a ticket for this.
done, #535
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this
I'm not trying the trunk, and it's the first time I use filter_by, but I
guess:
MappedClass.query().filter_by( MappedClass.column_name == 'Foo' )
equates to filter_by(False), because the .c is missing and it's
comparing an UOWProperty to a string, instead of a Column object to a string
I know I can have bound parameters in engine.text():
t = engine.text(select foo from mytable where lala=:hoho)
r = t.execute(hoho=7)
...but I need the same for connection.execute(), since I am using
temporary tables and they are not accessible via engine.text
Should I resort to manual
Andreas Jung wrote:
In a traditional application you can insert a new row and read the row
within the same transaction. What is the typical usage pattern to deal
with this in SA? In our particular setup (Zope) a new session is
created for
each new HTTP request and flushed automatically at
Paul Johnston wrote:
Hi,
Well, more than improving the quality of the article, we need to make
a case for it being notable. The main criteria for this is:
Software is notable if it has been the subject of multiple
non-trivial published works whose source is independent of the
software's
svilen wrote:
how much OO u want?
He's not using a DBMS. He has more OO-ness than SA could give him :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
I'm working inside TurboGears, autoload everything.
Tested with 0.3.3 and Trunk.
I find this strange behaviour: when I declare a relation between a
Person and a Contract:
assign_mapper(context, Contract, tbl['contracts'], properties = {
'responsible' : relation(Person,
Marco Mariani wrote:
john.contracts_responsible
gives me
AttributeError: 'Person' object has no attribute 'contracts_responsabile'
this is a cut-n-translate-n-paste typo, should read
contracts_responsible of course
--~--~-~--~~~---~--~~
You received
milena wrote:
I have tried
select([func.count(*)], from_obj=[table_name]).execute()
but it didn't work
I suppore you're not using mappers, so this is the fastest method:
number_of_rows = table.count().execute().fetchone()[0]
where table is the table object
Michael Bayer wrote:
to have aliases of properties that are usable with get_by(), use the
synonym function, described in:
http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_overriding
Thank you. Altough the docs are very well done, there are many APIs and
that
Hi there
This relates to Turbogears, but is really a SA question.
I've customized TG authentication authorization to use my autloaded
tables in Postgres and SqlAlchemy 0.3.3.
In my schema, I have User.c.uid, the login name of the users, as a
primary key
TG uses a User mapper with two
Lee McFadden wrote:
Going from the line number in your exception that would be because
your columns are of type String. Change the columns to Unicode and it
should solve your problem.
foo_table = Table('foo', metadata,
Column('id', Integer, primary_key=True),
Column('bar',
Does sqlalchemy have some limit in handling composite primary keys with
autoload?
I've tried postgres 8.1 and SA 0.3 or trunk.
I have a 'tree' of four tables, and SA does not create the full join to
follow composite foreign keys.
The schema and test model is in the attachment.
As I've seen,
38 matches
Mail list logo