, only_load_props)
else:
state._commit_all(dict_, session_identity_map)
are there any events after this point in the loading/refresh process ?
On 4/30/21 4:03 PM, Mike Bernson wrote:
The load and refresh events is close to what I am looking for.
I need
Tue, Apr 27, 2021, at 3:43 PM, Mike Bernson wrote:
That callback look like it happening before orm instances are created. I am
looking for a
callback that is after all the instances are created. I am using the events to
get a list of instances
that need work done when they are loaded from the
m_execute_state.is_orm_statement:
result = orm_execute_state.invoke_statement()
rdbm_events.run_created()
return result
On Tue, Apr 27, 2021, at 12:35 PM, Mike Bernson wrote:
I am moving from version 1.0.14 to version 1.4.11 of sqlalchemy.
I need to get a callback whe
I am moving from version 1.0.14 to version 1.4.11 of sqlalchemy.
I need to get a callback when all of the data from orm query is loaded not just
single instance.
In the 1.0 version I created the session using query_cls:
self.session = Session(bind=engine, autoflush=False,
,
subq.c.cost_center == m.c.cost_center,
m.c.current_balance 0
)
)
)
print stmt
On Sep 15, 2014, at 7:49 PM, Mike Bernson m...@mlb.org wrote:
Here is simple table def
from sqlalchemy import *
db = create_engine('sqlite:///test.db')
metadata = MetaData(db)
trs_transaction = Table
Given the table below I am trying to get the where statement built
using just core. I have tried a number of thing and am not able to
get the query built.
I can get the query close but not correct. I must be missing something
simple.
The database is Mysql and SQLAchemy is 9.7
The query does
to send (simplified, succinct) table defs i can show you how to get
that in core.
On Sep 15, 2014, at 6:39 PM, Mike Bernson m...@mlb.org wrote:
Given the table below I am trying to get the where statement built
using just core. I have tried a number of thing and am not able to
get the query built
I have started moving my code base from 0.7.10 to 0.8.7 as first step to getting
to current version. (There code changes for me to get to 0.9.x where there are
no code changes to run under 0.8.x)
I have found a problem with a query that worked on 0.7.10 and now fails
with a raise.
The code is
from sqlalchemy import *
meta = MetaData()
stx_setup = Table(stx_setup, meta,
Column('id', BigInteger(display_width=20), primary_key=True, autoincrement=T
rue),
Column('cost_center', Integer(display_width=1), index=True, nullable=True),
Column('AdministratorLicense',
Looking at the events for instances.
The on_expire passes a list of attributes being expired but the on_refresh does
not have a list of attribute being refresh.
Can the list of attribute being refreshed be add to on_refresh event ?
I am looking to move from using mapperextension to instance
I have a transaction started with begin
I then delete a record in the transaction.
I then commit and the commit fails.
I now want to continue by undelete the record but leave
record in the session.
I want to leave the record in the session because session
is doing caching.
The session is
Michael Bayer wrote:
On Jun 10, 2010, at 12:06 AM, Mike Bernson wrote:
I am trying to access a postgres database with mixed case column names.
I am using reflection to get the table.
Here is my connect string:
'postgresql://:mike@/cedar_senior_services'
The error message
I am trying to access a postgres database with mixed case column names.
I am using reflection to get the table.
Here is my connect string:
'postgresql://:mike@/cedar_senior_services'
The error message:
(ProgrammingError) column active does not exist
LINE 1: select * from license where
Thanks
Setting column.type worked like a charm for me.
Michael Bayer wrote:
On May 31, 2010, at 10:01 PM, Mike Bernson wrote:
I would like to restore the TINYINT(1) for all tables.
I am using reflection to get the tables.
The docs talk about passing in override value for the columns that I
I would like to restore the TINYINT(1) for all tables.
I am using reflection to get the tables.
The docs talk about passing in override value for the columns that I to
want change from the database as parameters to the table object on
when reflecting. Since I have no idea what columns are
will try just setting column.type I have not thought about doing that.
Setting the dialect.ischema_names will not work because I only want to
get tinyint(1) not all tinyint.
Michael Bayer wrote:
On May 31, 2010, at 10:01 PM, Mike Bernson wrote:
I would like to restore the TINYINT(1) for all
I am getting warning using 0.6beta2.
The database is mysql.
I get the following warning:
/usr/local/ltcd/lib/SQLAlchemy-0.6beta2-py2.6.egg/sqlalchemy/dialects/mysql/base.py:2241:
SADeprecationWarning: Manually quoting ENUM value literals is deprecated.
Supply unquoted values and use the
I am trying to move from 0.5beta4 to 0.5.2
The attribute events are giving me a problem
The code worked in 0.5beta4 and now is broken.
class base(object):
__sa_instrumentation_manager__ = SetListener
listener = ReceiveEvents()
class SetListener(InstrumentationManager):
def
is assembled.
Mike Bernson wrote:
I am trying to move from 0.5beta4 to 0.5.2
The attribute events are giving me a problem
The code worked in 0.5beta4 and now is broken.
class base(object):
__sa_instrumentation_manager__ = SetListener
listener = ReceiveEvents()
class
I am looking at how to have 2 engines a session.
I want to be able to switch between engine used based on
if any writes will be happening to the data being read. I
can tell if any data will be modify by if the transaction
started by issues a begin.
I want to setup a number of server doing
Glad to known that it that simple.
Thanks
Michael Bayer wrote:
On Nov 8, 2008, at 3:07 PM, Mike Bernson wrote:
I am looking at how to have 2 engines a session.
I want to be able to switch between engine used based on
if any writes will be happening to the data being read. I
can tell
.
On Sep 27, 2008, at 1:52 PM, Mike Bernson wrote:
I have a problem with row coming back form mapped class that has
relations.
The session is created with:
self.session = Session(bind=self._engine, autoflush=False,
_enable_transaction_accounting=False
The set method has changed from 0.5b3 to 0.5rc1.
The old set method set the value before it called the set method
in attribute extension. The new method set the value after the
set method is called.
This is cause me problems because the methods that I am dispatching
to think the attribute is
Michael Bayer wrote:
On Sep 28, 2008, at 8:23 PM, Mike Bernson wrote:
The set method has changed from 0.5b3 to 0.5rc1.
The old set method set the value before it called the set method
in attribute extension. The new method set the value after the
set method is called.
This is cause
I have a problem with row coming back form mapped class that has relations.
The session is created with:
self.session = Session(bind=self._engine, autoflush=False,
_enable_transaction_accounting=False, autocommit=True,
weak_identity_map=True)
The problem occurs with
, at 1:52 PM, Mike Bernson wrote:
I have a problem with row coming back form mapped class that has
relations.
The session is created with:
self.session = Session(bind=self._engine, autoflush=False,
_enable_transaction_accounting=False, autocommit=True
I am looking for a hook after a instance has been created, attribute
populated and any initialization done. I have found populate_instance
in the MapperExtension. It look like to close thing.
Adding a hook to MapperExtension for after instance is created,
populated, and any initialization by the
Is the stuff from user_defined_state branch merge in ?
If so is the __sa_instrument_class__ stuff the same ?
Michael Bayer wrote:
hey list -
as you might have noticed we've merged 0.5 into the trunk. this
version is already spectacular and I encourage everyone to start
poking
I am trying to use models that inherit from dict.
The models use attribute access for the sqlachemy attributes and dict style
access for gui stuff.
This allow me to do things like model[column_name].editable for gui to see if
item should be grayed
out and model.column_name for access the
dict.
On Sat, Mar 29, 2008 at 3:08 PM, Mike Bernson [EMAIL PROTECTED] wrote:
I am trying to use models that inherit from dict.
The models use attribute access for the sqlachemy attributes and dict style
access for gui stuff.
This allow me to do things like model[column_name].editable
I have attached the code doing the write to the database
and a traceback with local variable being display for
each frame.
I am also attaching a run with nothing catching the error
so you can see the simple traceback with the exception.
Here is output from mysql show this has gone a long way
You are correct.
Sorry I some how skipped over the last entry.
Thanks
jason kirtland wrote:
Mike Bernson wrote:
I have attached the code doing the write to the database
and a traceback with local variable being display for
each frame.
I am also attaching a run with nothing catching
I have a case where a delete was requested and on the commit to the transaction
the delete fails with a
integrity error. Problem is a foreign key constraint will not let the record be
delete. Now I have a
session which tries to delete this record any time I flush things. I have
rolled back the
Michael Bayer wrote:
On Feb 8, 2008, at 1:06 PM, Mike Bernson wrote:
I have a case where a delete was requested and on the commit to the
transaction the delete fails with a
integrity error. Problem is a foreign key constraint will not let
the record be delete. Now I have a
session
Database is mysql
I am having a problem with unicode and binary type.
I am using an XML parse the return Unicode strings.
I have a table in mysql with the default character set as utf8
I set the charset to utf8 in the connect string to charset=utf8
I am trying to send a unicode string to the
Mike You just need pick letter that are after release. Thing like p1 is greater
then release
from the egg docs.
(A note about versions: the egg runtime system understands typical version
numbering schemes, so it knows that versions like 1.2a1 and 1.2rc5 are
actually older than the plain
I have code that need to do a mysql replace instead of an insert.
The quick hack to just create a string and execute has problems with
quoting things, sql injection ...
If a table.replace() is not easy to do is there a way to create a statement
that works that way. If I could do a
].type) for key in keys])
trans = conn.begin()
conn.execute(replace(mytable, ['one', 'two', 'three']), [{'one':1,
'two':2, 'three':3}, {...}, {...}, ...])
trans.commit()
On Jan 4, 2008, at 1:27 PM, Mike Bernson wrote:
I have code that need to do a mysql replace instead of an insert
Is there any chance of making it an option to not
have a weak reference ?
How about something on the session level with sessionmaker ?
Having it the session level would help me but not sure if make sense there.
I have things in the model object that depend on the object not going
away. I have
can it also be added to 3.9 ?
jason kirtland wrote:
[this one seems to have been lost in googlegroups too, resending...]
Mike wrote:
I started looking to what is happen to get table information from
mysql.
I found that the following is issued for every table that is
reflected:
sounds good. Looking forward to see it in 3.10dev
jason kirtland wrote:
Mike wrote:
can it also be added to 3.9 ?
Sure, if there's another release in the 0.3 line the case-check
cache can go in. But the only use SHOW CREATE change will be
likely be a 0.4-only thing.
-j
I started looking to what is happen to get table information from mysql.
I found that the following is issued for every table that is reflected:
2007-07-18 00:29:08,158 INFO sqlalchemy.engine.base.Engine.0x..cc show
variables like 'character_set%%'
2007-07-18 00:29:08,158 INFO
of mysqldb.
Thanks for the help
Michael Bayer wrote:
On May 24, 2007, at 10:12 PM, Mike Bernson wrote:
It give me an error attaching output
well that tests passes for everyone else AFAIK, so maybe something is
up with either the way youre connecting to MySQL (are you turning
:
On May 24, 2007, at 10:12 PM, Mike Bernson wrote:
It give me an error attaching output
well that tests passes for everyone else AFAIK, so maybe something is
up with either the way youre connecting to MySQL (are you turning on
the use_unicode flag? ) or maybe your version of MySQLDB
44 matches
Mail list logo