Hi,
I'm trying to use SqlSoup with firebird backed.
My environment is: python 2.6, sqlalchemy 0.6.3 all in virtualenv.
The firebird version is 2.1
I do all steps to do a simple test:
db = SqlSoup('firebird://SYSDBA:master...@127.0.0.1/home/maxi/
databases/test.fdb')
people = db.people.all
, queries_group, properties={
'children': relation(QueryGroup, cascade=all,
backref=backref(parent, remote_side=
[queries_group.c.qry_grp_id]))
}
)
Can I do the same using declarative style? How?
Thanks in advance.
---
Maxi
Hi,
Are there any approach to get columns names from query result ?
I'm executing a dynamic sql statemet using text function and execute.
s = 'select * from foo where foo.name like = :name'
txt = text(s, bind=database.metadata.bind)
p = {'name':u'some name'}
result = txt.execute(p).fetchall()
Hi,
I've a problem to do a many to many relationship mapper declaration.
I will try to explain this with an example:
person_table(per_id, name, ...)
per_per_table(id, per_orig_id, per_dest_id)
per_orig_id = foreign key, reference to person_table.per_id
per_dest_id = foreign key, reference to
Hi,
I need to use substring function into sql statement. For it, I define
the next sql:
_sql = select([func.substring(planilladet.c.msg_debug, 1,
40).label('msg_debug'), func.sum(planilladet.c.cant).label('cant'),
func.sum(planilladet.c.cant * planilladet.c.importe).label('importe')],
\
(ProgrammingError) (-104, 'isc_dsql_prepare: \n Dynamic SQL Error\n
SQL error code = -104\n Token unknown - line 1, column 39\n ,')
'SELECT substring(planilladet.msg_debug, ?, ?) AS msg_debug,
sum(planilladet.cant) AS cant, sum(planilladet.cant *
planilladet.importe) AS importe \nFROM
is the SQL emitted ?
No, It isn't.
By example, if I modify master record data usr1.name = new name and
modify any addresses object (like first example)
the sql statement (UPDATE) is generated for users table but not for
addresses table.
is it possible your session is in an open
transaction and
Great Job !!!
How can I upgrade from 0.4.2p3 ? (Or I have to uninstall all previous
version?)
Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Hi,
I'm reading sqlalchemy 0.4 documentation about how execute a sql text
from session obejct.
In this example,
Session = sessionmaker(bind=engine, transactional=True)
sess = Session()
result = sess.execute(select * from table where id=:id, {'id':7})
It's only present in 0.4.x versions ?
How
Thanks for your replay,
The easiest in this case is to use query.populate_existing():
sess.query(Person).populate_existing().filter_by().all()
however, this method is only available in 0.4.
How work this ?
This method - populate_existing() - re-read from database ?
in 0.3, several
Thanks Simon,
I was doing of that manner.
Now, is advisable implement my own custom collection ? (One what
implement a locate method for example)
I was reading Custom Collection Implementations on sqlalchemy doc, but
I'am not very clear over how implement this.
Any help with this?
Regards.
Hi,
I will try to expose my scenario:
I'am using sqlalchemy 0.3.10, Firebird 2.0.x and PyGtk for build a
desktop application in Windows XP.
I've a window form which contains a gtk TreeView (and many other
widgets). This is used for data entry in a master/detail structure.
Then, I've a mapper
One more thing,
I remove the many to many mapper (for ConvPre class and the associated
mapper) and:
- This work fine on sa 0.4.x
- This don't work on sa 0.3.10
Are there any changes relative a this problem in 0.4.x versions ?
--~--~-~--~~~---~--~~
You received
Hi,
I've a problem like this:
http://groups.google.be/group/sqlalchemy/browse_thread/thread/e3ff5bd168f5045a
Now, I'am using sqa 0.3.10, and a very complex mapper estructure.
orm.mapper(PrestacionGrupo, prestacion_grupo)
orm.mapper(Prestacion, prestacion, properties={
'grupo':
the error is specifically about a many to many table where it expects
to delete two rows but only one matches the criteria. If you are
using more than one session, or removing rows from a many to many
table using SQL statements, this error can occur.
Sorry, I'am a little confuse abut it. (I
do you have anything else mapped to the conv_pre table ? it should
*only* be mentioned in one place in your mapping setup.
I only have something like this:
class ConvPre(DBObject):
pass
mapper(ConvPre, conv_pre)
--~--~-~--~~~---~--~~
You received this
OK, then you *cannot* use conv_pre as the secondary argument in
another relation(). You need to use an association:
If I remove ConvPre class and conv_pre mapper too. This problem is
solved ?
I don't need this class and mapper really.
BTW, I will take a look to associationproxy, this look
Hi,
I've an error when I try to execute a clear() method from session
object.
Traceback (most recent call last):
File V:\nacer\bin\gui\planilla.py, line 280, in
on_btn_apply_clicked
self._savePlanilla()
File V:\nacer\bin\gui\planilla.py, line 200, in _savePlanilla
Hi,
I recently upgrade from sqlalchemy 0.3.10 to 0.4.2p3.
I have a method like this:
def getPlanillaDet(self, plan_id):
return
session.query(PlanillaDet).filter_by(Planilladet.c.plan_id==plan_id).all()
Now, after update, when I try to execute this method, I get an
exception with the
Thaks for your help.
Can you post an example over how to use filter and filter_by in new
sqlalchemy versions?
Is your recommendation included in 0.3 to 0.4 migration guide?
Why this change?
Regards.
--~--~-~--~~~---~--~~
You received this message because you
Hi,
In new sqlalchemy version (0.4), the MapperExtension must return
EXT_CONTINUE for each method. Now, all methods must return this const?
For instance,
I've the next extension for my mapper:
class ConvenioExtension(MapperExtension):
def create_instance(self, mapper, selectcontext, row,
Hi,
Follwing with my 0.3 to 0.4 upgrade, now I get the next problem...
When I try to save an object across my session, I get an
InvalidRequestError exception with the message:
File c:\programs\python25\lib\site-packages\sqlalchemy-0.4.2p3-
py2.5.egg\sqlalchemy\orm\session.py, line 988, in
I must use save_update alone or save_update + flush ?
--~--~-~--~~~---~--~~
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 from this
But, is my design mistake ?
I must use ever save_or_update() function?
In my case, I have two process working over the same class of
bussines object.
I do a query, which return me an object list and I call to other
function which pass one parameter (id) and this function do other
query over the
Is solved the problem involved in py2exe and sqlalchemy 0.3 ?
Can I use py2exe without problem with loggin module?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
Hi,
I hope sombody can help me whit this.
I've the next table, for instance:
customer = Table('customer', metadata,
Column('id', Integer, primery_key=True),
Column('name', String(50), nullable=False)
)
andthe class
class Customer(object):
pass
and.. the mapper
26 matches
Mail list logo