, 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 to
s well with eager loaders though.
On 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
te_state):
if orm_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 g
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,
_enable_transa
nter,
m.c.current_balance
]).select_from(subq.join(
m, and_(
subq.c.max_invoice_date == m.c.invoice_date,
subq.c.account == m.c.account,
subq.c.cost_center == m.c.cost_center,
m.c.current_balance > 0
)
)
)
print stmt
On Sep 15, 2014, at 7:49 P
#x27;invoice_date', 'account',
'cost_center', unique=True),
)
metadata.create_all()
On 09/15/2014 07:04 PM, Michael Bayer wrote:
if you want 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
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 wor
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 fa
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', String(length=
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 e
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 created
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 err
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 Active
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
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 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 TINYIN
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 quoti
There is a way to catch every modify event at the time it is being modify.
This is some code I use to send events when attribute are modified.
There is an attribute that you can put on the model class
__sa_instrumentation_manager__ = SetListener
and then here is code to handle modify events:
c
s at the point at which the "AttributeImpl" 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.
>&
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 instru
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 ha
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 Replic
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
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 set
act issue.
>
>
> >
>
>
>
>
>
>
>
> 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 creat
act issue.
>
>
> >
>
>
>
>
>
>
>
> 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._en
looks to be working.
Michael Bayer wrote:
>
> On Sep 27, 2008, at 12:35 AM, Mike Bernson wrote:
>
>> I have a number of database that have the same tables in them.
>>
>> I create a session for 1 data and do some work. This work causes
>> a number of table tabl
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 insta
I have a number of database that have the same tables in them.
I create a session for 1 data and do some work. This work causes
a number of table table object to be reflected from the database
and then mapped. This works fine.
Now I Switch to another database which has the same tables. If I
acce
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 a
Michael Bayer wrote:
>
> On Apr 4, 2008, at 8:06 PM, Mike Bernson wrote:
>
>> user = Table('users', metadata,
>> Column('id', Integer, primary_key=True),
>> Column('account_name', String(64)))
>>
>>
user = Table('users', metadata,
Column('id', Integer, primary_key=True),
Column('account_name', String(64)))
address = Table('mail', metadata,
Column('id', Integer, primary_key=True),
Column('user_id', Integer, ForeignKey('users.id')),
Column
t inherit from 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 stu
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 column
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
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
int
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
>>
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
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 ve
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
r key in keys))
> )
> return text(statement, bindparams=[bindparam(key,
> type_=table.c[key].type) for key in keys])
>
> trans = conn.begin()
> conn.execute(replace(mytable, ['one', 'two', 'three']), [{'one':1,
> 'two
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 conn.execute(s
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
Using SQLAlchemy version 0.4b4. When reflecting
table from mysql database with tinyint(1) you get
a boolean back. I think this is error because it
returns a bad data type for tinyint(1).
I have a database that work under 0.3.0 where to
store a single digit I used tinyint(1) and now this
breaks un
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
>
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
>> reflect
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 sqlalchemy.engine
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 connectin
will do some more testing on friday afternoon.
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 your
I also just tried using a blob to replace longblob as blob is in the
list of types for mysql and longblob was not. I get the same error
Mike Bernson wrote:
> I am trying to insert binary data (PDF) into the follow table in mysql
> 5.0.22 using python 2.4 and SQLAlchemy 3.7.
>
I am trying to insert binary data (PDF) into the follow table in mysql
5.0.22 using python 2.4 and SQLAlchemy 3.7.
I get exception:
sqlalchemy.exceptions.SQLError: (UnicodeDecodeError) 'ascii' codec can't
decode byte 0xff in position 14: ordinal not in range(128)
CREATE TABLE `mds_report` (
Mysql has a timeout idle connection. You might be running into this. I
think it defaults to 8 hours It sounds like you are running into the
idle timeout.
dischdennis wrote:
> Hi I am using sqlalchemy with zope and when I have the server running
> a while (> 6 hours) without interaction, I cannot
use the lockmode='update' on a query object.
row_obj = query_obj.select(where, lockmode='update').execute()
Basil Shubin wrote:
> Hi friends!
>
> I have use SQLAlchemy 0.3 with MySQLdb 1.2.1 How I can lock row in
> database table when I select it? So nobody can access it in same time.
> BTW I
to make sure that I am not overlooking something.
Robin Munn wrote:
> On 10/25/06, Mike Bernson <[EMAIL PROTECTED]> wrote:
>> I am written a program that load mysql database from a flat file.
>> The table I am loading has a large number of columns about 800.
>
> 800 col
I am written a program that load mysql database from a flat file.
The table I am loading has a large number of columns about 800.
Here is simple version of what I am doing:
records = []
for line in lines:
record = {}
for col in columns:
record[col] = line[info[col
56 matches
Mail list logo