Hello,
I tried all the method to compare the different methods :
*TEST CODE*
xref = time.time()
self.UtilisateurCourant.Dispo = 1
session.merge(self.UtilisateurCourant, dont_load=True)
session.flush()
print With ORM dont_load,
Hi, there.
Just trying to make SA work with combined type field.
First, I have such a type in PGSQL:
CREATE TYPE mytype AS
(id integer,
flags integer,
degrees numeric[]);
Then I create a column in table 'mytable' as
ALTER TABLE mytable ADD COLUMN tmpcol mytype[];
Then I declare
Hi again,
Is there any way to avoid checking database structure during the
metadata.create_all declaration's phase?
It can be good to check when we are in test phase but when we are in
production and we are sure of our model, it can be good to bypass create_all
checking to database.
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Christian Démolis
Sent: 01 October 2009 10:40
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Bypass checking to database structure
(metadata.create_all)
Hi again,
Thx Simon,
I tried Base.metadata.create_all(engine, checkfirst=False)
but it throws an error.
When checkfirst is True, the declaration works.
I don t understand...
Maybe orm needs additional information in declarative classes when
checkfirst=False because orm doesn t look in database in this
On Thu, Oct 1, 2009 at 6:25 PM, Christian Démolis
christiandemo...@gmail.com wrote:
Thx Simon,
I tried Base.metadata.create_all(engine, checkfirst=False)
but it throws an error.
When checkfirst is True, the declaration works.
I don t understand...
Maybe orm needs additional information in
I have looked all over to a solution for this issue and haven't found
a solution. I am trying to use inheritance more than one level deep
and it does not seem to set the discriminator field on the top level
item. It works fine if it is only subclassed once but when you try and
do it twice it
Ok, i just realize that create_all is useless when database already exist.
Starting my application is 6 seconds faster now.
Thanks all
2009/10/1 limodou limo...@gmail.com
On Thu, Oct 1, 2009 at 6:25 PM, Christian Démolis
christiandemo...@gmail.com wrote:
Thx Simon,
I tried
Micheal:
Thanks for your help thus far. Unfortunately I don't think the
get_dbapi_type method gets called. From reading your code I see how it
should be called from pre_exec - setinputsizes - get_dbapi_type but
empirical evidence shows otherwise. Here's my little harness:
import
Christian Démolis wrote:
Hello,
I tried all the method to compare the different methods :
*TEST CODE*
xref = time.time()
self.UtilisateurCourant.Dispo = 1
session.merge(self.UtilisateurCourant, dont_load=True)
session.flush()
volx wrote:
Micheal:
Thanks for your help thus far. Unfortunately I don't think the
get_dbapi_type method gets called. From reading your code I see how it
should be called from pre_exec - setinputsizes - get_dbapi_type but
empirical evidence shows otherwise. Here's my little harness:
Hey,
Michael Bayer wrote:
[snip]
OK well I'm sure you noticed that RelationProperty was not designed to be
subclassed. I would advise that your my_own_relation() function generate
its own primaryjoin and secondaryjoin conditions which it passes as
arguments to the relation().
Looking at
Michael Bayer wrote:
Christian Démolis wrote:
Hello,
I tried all the method to compare the different methods :
Here's a decorator I would advise using:
http://stackoverflow.com/questions/1171166/how-can-i-profile-a-sqlalchemy-powered-application/1175677#1175677
Also I would advise
Martijn Faassen wrote:
Hey,
Michael Bayer wrote:
[snip]
OK well I'm sure you noticed that RelationProperty was not designed to
be
subclassed. I would advise that your my_own_relation() function
generate
its own primaryjoin and secondaryjoin conditions which it passes as
arguments to
With debug mode it seems to take 0.15 second, my timer print 0.45 s
i don t know why this difference?
2009-10-01 17:00:38,586 INFO sqlalchemy.engine.base.Engine.0x...7f50 UPDATE
utilisateur SET `Dispo`=%s WHERE utilisateur.`IdU
tilisateur` = %s
2009-10-01 17:00:38,586 INFO
Christian Démolis wrote:
With debug mode it seems to take 0.15 second, my timer print 0.45 s
i don t know why this difference?
2009-10-01 17:00:38,586 INFO sqlalchemy.engine.base.Engine.0x...7f50
UPDATE
utilisateur SET `Dispo`=%s WHERE utilisateur.`IdU
tilisateur` = %s
2009-10-01
I am very pleased to announce that version 0.7.0 of Elixir
(http://elixir.ematia.de) is now available. As always, feedback is
very welcome, preferably on Elixir mailing list.
This release incorporates many small improvements and bug fixes across
the board. Please look at
Hey,
Michael Bayer wrote:
subclass RelationProperty fine, but don't get involved with overriding its
internal _xxx methods.
So:
Override do_init() completely (not calling the super do_init()).
Do something like:
def do_init(self):
self._get_target()
Maybe because the database is in Tunisia and my Computer in France.
I don t use sqlite, i use MySQL.
I just did a test on internet in Tunisia, 39kbits/sec upload and
417kbits/sec
2009/10/1 Michael Bayer mike...@zzzcomputing.com
Christian Démolis wrote:
With debug mode it seems to take 0.15
I have a problem with updating custom types in SQLAlchemy, issue is
that when I modify object attributes they are not detected as
modified. E/g:
# python class to work with
class BDelta(object):
def __init__(self):
self.id = None
self.flags = None
self.deltas = []
Martijn Faassen wrote:
Hey,
Michael Bayer wrote:
subclass RelationProperty fine, but don't get involved with overriding
its
internal _xxx methods.
So:
Override do_init() completely (not calling the super do_init()).
no, call do_init().
def do_init(self):
self.primaryjoin =
Christian Démolis wrote:
Maybe because the database is in Tunisia and my Computer in France.
I don t use sqlite, i use MySQL.
I just did a test on internet in Tunisia, 39kbits/sec upload and
417kbits/sec
right but, you had these results:
MySQLdb - .09 seconds
ORM - .3 seconds
so, network
I am trying to write a datagrid library for sqlalchemy which will
allow easy generation of tables from SA objects. I would like the
datagrid to be able to accept a table column, declarative attribute,
or elixir entity attribute interchangeably. Since I am building the
SQL with queries, this has
Randy Syring wrote:
I am trying to write a datagrid library for sqlalchemy which will
allow easy generation of tables from SA objects. I would like the
datagrid to be able to accept a table column, declarative attribute,
or elixir entity attribute interchangeably. Since I am building the
Here's my program, modified as you suggest. It also creates the table
so you can try it on any instance of Oracle. No joy on the result.
Seems like the set_inputsizes isn't called? How can I tell for
certain?
import sqlalchemy.types as sqltypes
from exceptions import NotImplementedError
class
volx wrote:
Here's my program, modified as you suggest. It also creates the table
so you can try it on any instance of Oracle. No joy on the result.
Seems like the set_inputsizes isn't called? How can I tell for
certain?
import sqlalchemy.types as sqltypes
from exceptions import
I was trying to do the same thing, But i wanted a different
discriminator for the second level of inheritance.
I changed mine to use the same polymorphic_on for both levels and it
seemed to work for me (although not exactly how i wanted it to be)
My suggestion is :
Get rid of your engineer_id
not sure if the example was clear enough.
What I'm trying to do is to convert the following select to a mapped-
class:
select id, usr_id, rating,
( select COUNT(*) from ratings as r where r.id = ratings.id ),
( select AVG(r.rating) from ratings as r where r.id =
ratings.id)
Bj wrote:
not sure if the example was clear enough.
What I'm trying to do is to convert the following select to a mapped-
class:
select id, usr_id, rating,
( select COUNT(*) from ratings as r where r.id = ratings.id ),
( select AVG(r.rating) from ratings as r where r.id =
Previously I was doing development of a project on an Ubuntu 9.04
machine with MySQL 5.0 and just recently switched to doing development
on a MacBook Pro. I installed identical versions of MySQL on the
MacBook. I used the exact same source files and installed the same
versions of all libraries
30 matches
Mail list logo