apart of all runtime issues u've hit - session etc - on declaration
level u'll may do these:
- destroy all your refs to the mappers/tables etc
- sqlalchemy.orm.clearmappes()
- yourmetadata.drop_all()
- yourengine.dispose()
- destroy refs to yourmetadata/yourengine
(dbcook.usage.sa_manager.py
I understand that solution. I did say without a python property.
But if that's the only real way to do it, so be it. Maybe I was just
looking for an excuse to learn how to define a custom type. ;)
~jon
On Jan 23, 9:56 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008, at 10:16 PM,
Thanks for the info - what is the current version?
Alex
On Jan 22, 2008 2:36 PM, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> One thing I can see is that you're using an older version of SA, since
> that error message has been changed (either 0.4.0 or an old 0.3
> version). It means that you ca
On Jan 23, 2008, at 10:16 PM, Jonathon Anderson wrote:
>
> So, in constructing my test case, I figured out what was going on.
> (I'm sure this is often the case.)
>
> http://pastebin.com/m612561a6
>
> The problem is that process_result_value is only called when actually
> loading values from the
So, in constructing my test case, I figured out what was going on.
(I'm sure this is often the case.)
http://pastebin.com/m612561a6
The problem is that process_result_value is only called when actually
loading values from the database, and since a session maintains an
object cache for object ide
Hi All,
I'm starting a new project that will probably be using Twisted, but I
want to use SQLAlchemy as well. I saw a couple of old posts about
Asynchronous SQLAlchemy and two different implementations, but neither
sAsync nor nadbapi seem to be maintained (or at least have new
versions posted),
On Jan 23, 2008 4:36 PM, Kumar McMillan <[EMAIL PROTECTED]> wrote:
> ...but it still fails with the same error, Deleted rowcount 0 does not
> match number of objects deleted 1. What am I missing? I don't
> understand how the teardown code is dependent on the app code if it is
> using a different
Kumar McMillan wrote:
> Hello, I have not been able to figure this out from the docs.
>
> I would like to setup and teardown test data using mapped classes.
> The problem is that those same mapped classes need to be used by the
> application under test and in case there is an error, the teardown
Hi
On Jan 23, 2008 4:07 PM, Michael Bayer <[EMAIL PROTECTED]> wrote:
> your teardown code can't have any dependencies on the test code
> itself. So at the very least start the teardown phase with
> "PrivateSession.close()" so that you start fresh.
I tried adding that to the teardown code but th
On Jan 23, 2008, at 5:00 PM, Kumar McMillan wrote:
> Hello, I have not been able to figure this out from the docs.
>
> I would like to setup and teardown test data using mapped classes.
> The problem is that those same mapped classes need to be used by the
> application under test and in case th
Hello, I have not been able to figure this out from the docs.
I would like to setup and teardown test data using mapped classes.
The problem is that those same mapped classes need to be used by the
application under test and in case there is an error, the teardown
still needs to run so that subseq
On Jan 23, 2008, at 4:24 PM, Monty Taylor wrote:
>
> This may or may not be elixir specific...
>
> If I have an auto-generated mapping table for a many-to-many
> relationship, is there a sensible way to add another column to it
> that's
> also has a foreign key relationship to a third table?
>
On Jan 23, 2008, at 4:25 PM, Jonathon Anderson wrote:
>
> Oh, no. I'm not doing any raw sql.
>
> I have (at a most basic level):
>
> things_table = Table("things", metadata,
>Column("id", types.Integer, primary_key=True),
>Column("values", StringSet, nullable=True),
> )
>
> class Thing (
On Jan 23, 2008, at 3:28 PM, MattQc wrote:
>
> Object query returns an empty set:
>
> In <3>: jLane = tblspotbandsol.outerjoin(tbllane,
> tbllane.c.laneid==tblspotbandsol.c.laneid)
> In <4>: mapper(LaneClass,jLane)
> Out<4>:
> In <5>:
> Session.query(LaneClass).filter(LaneClass.spotbandsolid==3
Oh, no. I'm not doing any raw sql.
I have (at a most basic level):
things_table = Table("things", metadata,
Column("id", types.Integer, primary_key=True),
Column("values", StringSet, nullable=True),
)
class Thing (object):
pass
Session.mapper(Thing, things_table)
But when I do Thi
This may or may not be elixir specific...
If I have an auto-generated mapping table for a many-to-many
relationship, is there a sensible way to add another column to it that's
also has a foreign key relationship to a third table?
Like, if I had this:
Products
id int
name varchar
ProductTyp
Thanks guys for your help I'm going to give Hermanns methods a go.
Morgan
Hermann Himmelbauer wrote:
> Am Montag, 21. Januar 2008 01:16 schrieb Morgan:
>
>> Hi Guys,
>>
>> I have field that I want to put a unique identifier in. This unique Id i
>> would like to be a composite key or simply a
> 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 have different outputs depending on using a select statement as
oppose to an object mapped query. This is happening when I am using
outer joins.
Here is the trace of the select that gives me something:
In <1>: a = select([tblspotbandsol.c.spotbandsolid, tbllane.c.laneid],
tblspotbandsol.c.
On Jan 23, 2008, at 3:01 PM, Jonathon Anderson wrote:
>
> What do you mean by textual strings? Do you mean strings backed by a
> TEXT type, rather than a fixed-length string?
>
> Why won't that work?
no, i mean:
result = engine.execute("select * from table")
will not work with any TypeEngine
What do you mean by textual strings? Do you mean strings backed by a
TEXT type, rather than a fixed-length string?
Why won't that work?
On Jan 23, 10:57 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008, at 11:09 AM, Jonathon Anderson wrote:
>
>
>
> > I'm trying to use types.TypeDec
On Jan 23, 2008, at 2:34 PM, maxi wrote:
>
>
>> 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)
OK, then you
> 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
On Jan 23, 2008, at 2:15 PM, maxi wrote:
>
> Sorry, I'am a little confuse abut it. (I have only one session)
>
> I've the next table schema:
>
> convenio(conv_id) <--- conv_pre(conv_pre_id, conv_id, pre_id) --->
> prestacion(pre_id)(convenio many to many with prestacion across
> conv_pre)
On Jan 23, 2008, at 11:55 AM, Michael Bayer wrote:
>
>
> On Jan 23, 2008, at 10:25 AM, Alexandre Conrad wrote:
>
>> model.Player.query.join(['site', 'playlists', 'hotlinks',
>> 'hotslot']).filter(model.SlotHot.c.id=='foo').all()
>>
>
> another thing im considering, along the lines of what I ment
> 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.
Adrian wrote:
> I am trying to change the default column type mapping in sqlalchemy.
> Analogous to the description in the MySQLdb User's Guide (http://mysql-
> python.sourceforge.net/MySQLdb.html) I tried the following.
>
> from MySQLdb.constants import FIELD_TYPE
> my_conv = { FIELD_TYPE.DECIMA
On Jan 23, 2008, at 11:09 AM, Jonathon Anderson wrote:
>
> I'm trying to use types.TypeDecorator to define a set of strings
> stored in the database as a csv list, where the empty set is stored as
> null. process_bind_param seems to work, as values set on the bound
> field seem to get entered co
On Jan 23, 2008, at 10:25 AM, Alexandre Conrad wrote:
> model.Player.query.join(['site', 'playlists', 'hotlinks',
> 'hotslot']).filter(model.SlotHot.c.id=='foo').all()
>
another thing im considering, along the lines of what I mentioned in
http://groups.google.com/group/sqlalchemy/browse_thread
I'm trying to use types.TypeDecorator to define a set of strings
stored in the database as a csv list, where the empty set is stored as
null. process_bind_param seems to work, as values set on the bound
field seem to get entered correctly; but process_result_value never
seems to be called when rea
On Jan 23, 2008, at 10:25 AM, Alexandre Conrad wrote:
>
> Hello,
>
> still working intensivly with joined table inheritance. I have
> troubles
> making a long join across many tables. I need to query players from
> "player_table" where on the other end, slots_hot.id == 'foo':
>
> player_table
I am trying to change the default column type mapping in sqlalchemy.
Analogous to the description in the MySQLdb User's Guide (http://mysql-
python.sourceforge.net/MySQLdb.html) I tried the following.
from MySQLdb.constants import FIELD_TYPE
my_conv = { FIELD_TYPE.DECIMAL: float }
ENGINE = creat
Hi,
I have an existing piece of functionality but I am wondering if there
are ways to improve the code. A short summary what I have. I modelled
a person class which can have different roles, one being a student
role, another one being an employee role, an alumni role and so on.
Now I am trying to
Hello,
still working intensivly with joined table inheritance. I have troubles
making a long join across many tables. I need to query players from
"player_table" where on the other end, slots_hot.id == 'foo':
player_table = Table('players', meta,
Column('id', Integer, primary_key=True),
On Jan 23, 2008, at 8:01 AM, maxi wrote:
>
> I create an instance of Convenio [ convenio = Convenio() ]
> I do, convenio.prestaciones.delete(obj_instance) for delete a object
> from "prestaciones" list.
> Now, if I delete one object only, this work fine, but if I delete many
> (i.e: two obj) tha
If you're using easy_install to install them, you should be able to
install them with the '-m' (--multiversion) switch. See:
http://peak.telecommunity.com/DevCenter/EasyInstall#command-line-options
Choosing the version you want to use in your application is then done
like this:
import pkg_resou
Can I get two SqlAlchemy versions installed together?
I need have, sqlalchemy 0.3.10 and the 0.4 last release installed
because I have two version of my application (two diferents brunches).
How can I work whit this?
In my app, how can I indicate which version I want to use?
Thanks,
M.
--~--~---
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': relation(P
38 matches
Mail list logo